Distributed database transaction protocol

ABSTRACT

Technologies are described for facilitating transaction processing within a database environment having a coordinator node, a first worker node, and at least a second worker node. The first worker node sends a request from to the coordinator node for at least a first synchronization token maintained by the coordinator node. The first worker node receives the at least a first synchronization token from the coordinator node. The first worker node assigns the at least a first synchronization token to a snapshot as a snapshot ID value. The snapshot is executed at the first worker node. The first worker node forwards the snapshot ID value to the at least a second worker node.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation of, and incorporates by reference,U.S. patent application Ser. No. 14/866,449, filed Sep. 25, 2015, whichclaims the benefit of, and incorporates by reference, U.S. ProvisionalPatent Application No. 62/182,354, filed Jun. 19, 2015.

FIELD

The present disclosure generally relates to processing database read andwrite operations in a distributed environment. Particularimplementations relate to coordination of read and write operationsamong a coordinator host and one or more worker hosts.

BACKGROUND

Database performance can be enhanced by distributing information, suchas source tables, among multiple hosts. For example, a number of hostsmay store different tables in the database system, or tables can bepartitioned among multiple hosts. The ability to distribute a databasesystem among multiple hosts can provide opportunities to increase systemperformance, such as by distributing workloads among CPUs located at thedifferent hosts, rather than relying on the capabilities of a singlehost. However, distributed systems can present challenges in ensuringthat database operations are carried out in a way that provides querieswith accurate data, but without requiring so much coordination betweenhosts that the performance of the distributed system is significantlyadversely affected.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

Techniques and solutions are described for providing access to databaserecords stored at multiple hosts in a database environment that includesa coordinator node, a first worker node, and at least a second workernode. When a multi-node statement or transaction is received by thefirst worker node, the first worker node requests a globalsynchronization token maintained by the coordinator node. Thecoordinator node sends the global synchronization token to the firstworker node and starts a global snapshot associated with the request.The first worker node assigns the global synchronization token to thesnapshot as the snapshot ID value. The snapshot (such as a transaction,statement, or query) is executed at the first worker node and thesnapshot ID value is sent to the at least a second worker node. Thefirst worker node sends a request, such as asynchronously, to thecoordinator node to end the global snapshot associated with the request.The coordinator node ends the global snapshot when it receives therequest from the first worker node. The worker nodes may request andreceive additional synchronization tokens from the coordinator node,such as a watermark cached by the coordinator node and associated withthe status of the first or second worker nodes.

In another aspect, the present disclosure provides for managing commitoperations for statements or transactions executed at multiple nodes ina system that includes a coordinator node and a worker node. The workernode sends the coordinator node a precommit notification associated witha write operation at the worker node. The coordinator node increments aglobal synchronization token maintained by the coordinator node andassigns the incremented global synchronization token as a commit ID forthe database write operation. The commit ID for the database writeoperation is sent to the worker node. The worker node assigns the commitID to the database write operation at the worker node and marks thewrite operation as committed. In a particular implementation, after theworker node sends the coordinator node the precommit notification, theworker node stores the write operation in persistent storage, such as ina write log. For example, the worker node may store the write operationwithout waiting to receive the commit ID for the transaction from thecoordinator node.

In further implementations, the coordinator node precommits the writeoperation at the coordinator node using the commit ID and commits thewrite transaction after receiving a communication from the worker nodethat the worker node assigned a commit ID to the write transaction. Thecoordinator node sends a communication, such as an asynchronouscommunication, to the worker node to commit the transaction at theworker node.

As described herein, a variety of other features and advantages can beincorporated into the technologies as desired.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram depicting a database environment having acoordinator node and a plurality of worker nodes in which at leastcertain implementations of a disclosed distributed transaction protocolmay be used.

FIG. 2 is a diagram depicting an architecture of a transaction contextproviding version space management that may be used in at least certainimplementations of a disclosed distributed transaction protocol.

FIG. 3 is a diagram illustrating properties of snapshot monotonicitythat may be provided by at least certain implementations of a discloseddistributed transaction protocol with reference to an arbitrary pair ofsnapshots and an arbitrary pair of write transactions.

FIG. 4 is a diagram illustrating operations occurring at first andsecond nodes in a distributed database environment using vectorizedtransaction coordination.

FIG. 5 is a diagram illustrating operations occurring at first andsecond nodes in a distributed database environment using incrementalsnapshot timestamp transaction coordination.

FIG. 6 is a diagram illustrating operations occurring at a coordinatornode and a worker node for a local snapshot of the worker node using atleast certain implementations of a disclosed distributed transactionprotocol.

FIG. 7 is a diagram illustrating operations occurring at a coordinatornode and first and second worker nodes for a global snapshot, underwhich statements at each of the first and second worker nodes areexecuted, using at least certain implementations of a discloseddistributed transaction protocol.

FIG. 8A is a flowchart of an example method summarizing actionsoccurring at a coordinator node during an embodiment of the presentdisclosure for managing snapshots.

FIG. 8B is a flowchart of an example method summarizing actionsoccurring at a worker node during an embodiment of the presentdisclosure for managing snapshots.

FIG. 9 is a diagram illustrating an operation ordering that may be usedwith a least certain implementations of a disclosed distributedtransaction protocol.

FIG. 10 is a diagram illustrating how a write transaction commits, usingat least certain implementations of a disclosed distributed transactionprotocol, when it has only updated tables at a coordinator node.

FIG. 11 is a diagram illustrating how a write transaction commits, usingat least certain implementations of a disclosed distributed transactionprotocol, when it has only updated tables at a single worker node.

FIG. 12 provides an architecture that may be used with at least certainimplementations of a disclosed distributed transaction protocol to groupcommunication requests and commit requests at a worker node to be sentto a coordinator node.

FIG. 13 is a diagram illustrating operations providing snapshotmonotonicity occurring at first and second worker nodes using at leastcertain implementations of a disclosed distributed transaction protocol.

FIG. 14 is a diagram illustrating how a write transaction commits, usingat least certain implementations of a disclosed distributed transactionprotocol, when it has updated tables at first and second worker nodes.

FIG. 15 is a diagram illustrating operations providing visibilityatomicity occurring at first and second worker node using at leastcertain implementations of a disclosed distributed transaction protocol.

FIG. 16A is a flowchart of an example method summarizing actionsoccurring at a coordinator node during an embodiment of the presentdisclosure facilitating transaction consistency.

FIG. 16B is a flowchart of an example method summarizing actionsoccurring at a coordinator node during an embodiment of the presentdisclosure facilitating transaction consistency.

FIG. 16C is a flowchart of an example method summarizing actionsoccurring at a worker node during an embodiment of the presentdisclosure facilitating transaction consistency.

FIG. 17 is a diagram of an example computing system in which somedescribed embodiments can be implemented.

FIG. 18 is an example cloud computing environment that can be used inconjunction with the technologies described herein.

DETAILED DESCRIPTION Example 1—Overview

Database systems are increasingly designed and optimized formemory-centric, massively-parallel data processing, not only in singledatabase systems, but also in multi-host distributed database systems.Partitioning and distributing a database into multiple hosts is adesirable feature especially for high-performance in-memory databasesystems, because it can leverage larger in-memory database spaces and ahigher number of CPU cores beyond the limitations of a single physicalmachine (also referred to as a host, or node). For example, bypartitioning and distributing large and fast growing fact tables overmultiple hosts while replicating infrequently-updated dimension tablesin a data warehouse system, or by partitioning a multi-tenant databaseinto multiple hosts by tenants, it is typically possible to handlelarger databases and higher workloads.

However, it would be beneficial to have a distributed transactionprotocol which can provide scalable transaction processing performancewithout sacrificing transactional consistency. One way of attempting toensure full transactional consistency, as in a single node scenario, isto have a centralized transaction coordinator and synchronize allexecuted transactions with the coordinator. Unfortunately, such aprotocol typically does not scale well in terms of performance due tofrequent and expensive inter-node network communications between thecoordinator and the worker nodes. Another way to attempt to ensuretransactional consistency is to achieve high multi-node scalability byspecifying the provided transactional consistency level for targetapplication domains, mostly by weakening the transactional consistencyto some extent. This approach may not be acceptable for database systemswhere inconsistent transactions cannot be tolerated.

Particular embodiments of the present disclosure provide a distributedtransaction protocol that can show scalable transaction processingperformance in a distributed database system without compromising thetransaction consistency typically used in snapshot isolation. In atleast certain implementations of the disclosed distributed transactionprotocol, a “snapshot” refers to view of the database system, or atleast a portion thereof, as it existed at the time of the snapshot. Forexample, a query started under a particular snapshot would haveavailable to it records as they existed at the time of the snapshot. Thequery would not see, for example, changes that were made to the recordsafter the snapshot was acquired. In addition, in at least certainimplementations, records are not removed if there is an open snapshotthat will access them.

Snapshot isolation provides that all read operations in a transactionwill see a consistent version, or snapshot, of the relevant databaserecords. In terms of its performance, the disclosed distributedtransaction protocol shows scalable transaction processing performancein distributed database systems by minimizing and optimizing inter-nodetransaction coordination.

The present disclosure can also provide a transaction consistencyproperty, snapshot monotonicity, that can be used in systems along withACID (atomicity, consistency, isolation, durability) properties.Snapshot monotonicity is related to snapshot isolation, and illustrateswhy the coordination in the disclosed transaction protocol can bebeneficial.

Implementations of a transaction commit protocol are described in termsof sub operations in order to show how sub operations relate andinteract in order to meet desired transaction consistency goals.

Certain embodiments of the present disclosure also provide practicaloptimizations that are exploited by the disclosed distributedtransaction protocol. These optimizations include (a) reducingtransaction commit latency by interleaving inter-node coordinationnetwork operations with log persistency I/O operations, (b) grouping andcoalescing inter-node network I/O requests for better throughput, (c)performing lock-free transaction commit operations by exploiting thein-doubt transaction state of changed records, (d) reducing the latencyof visibility decision operations by early pruning of invisible recordversions using a precommit timestamp, and (e) reducing the latency oftransaction commit operations by acknowledging earlier during multi-nodetransaction commit operations.

Example 2—Distributed Database Environment

This Example 2 describes an example distributed database system that maybe used with at least certain embodiments of the disclosed distributedtransaction protocol, and characteristics and consistency properties ofexample workloads. This Example also describes a particularimplementation of snapshot isolation for use in an implementation of thedisclosed distributed transaction protocol.

FIG. 1 illustrates a database environment 100 having a plurality ofdatabase nodes 110 connected through a network 120. In a particularexample, the network 120 is a high-speed/low-latency network. A hostrefers to a computing system having a processor and memory. A host mayalso be referred to a node. Unless the context clearly indicatesotherwise, a node can refer to the host in a single host system (such asingle worker node), or one of a plurality of hosts in a system (such asone of a plurality of worker nodes).

As shown, each node 110 has its own persistency store 130. In someexamples, one or more nodes 110 may have shared storage. In a particularexample, such as for disaster recovery purposes, a remote instance ofthe system 100 can be configured to act as a hot standby cluster bycontinuously replaying logs shipped from the primary cluster 100.

The database nodes 110 are asymmetric, in some respects, since databasenode 140 has the role of a coordinator node and database nodes 150function as worker nodes. A coordinator node refers to a node (or host)that manages information regarding the coordinator node and one or moreworker nodes. A worker node refers to a node that is installed on adifferent host than the coordinator node and has at least some of itsactivities or operations controlled or regulated by a coordinator node.

The coordinator node 140 and the worker nodes 150 are in communication,such as through the network 120, and may send and receive communicationsto and from one another. As used herein, the term “send” to adestination entity refers to any way of transmitting or otherwiseconveying data within a computer system or between two computer systems,whether the data is directly conveyed or through one or moreintermediate entities. Similarly, the term “receive,” such as to receivefrom a source entity, refers to the receipt of data within a computersystem or between two computer systems, whether the data is receiveddirectly from the computer system of original transmission or receivedthrough one or more intermediate entities.

Although the coordinator node 140 stores tables and partitions, thespecific role of the coordinator node 140 is to act as a metadata masterand a transaction coordinator for distributed transactions. For example,when a client 160 seeks to access metadata at a worker node 150, theworker node retrieves the corresponding metadata from the coordinatornode 140 and caches it locally. The cached metadata for a specificdatabase object will be valid until the next DDL (data definitionlanguage) transaction is committed for that particular database object.Furthermore, being the transaction coordinator, the coordinator node 140decides about the commit of multi-node write transactions and mediatesbetween the worker nodes 150 when they need to exchange transactionalinformation with each other.

The database nodes 110 are symmetric, in other respects, as each node110 has its own persistency store 130 for log and checkpoint files. Fromthe perspective of a client 160, an application may connect to any ofthe database nodes 110 and execute arbitrary read and writetransactions. Tables can be partitioned and distributed across multipledatabase nodes 110. If a table has partitions defined via hash or rangepredicates, then those partitions can be distributed and stored indifferent nodes 110.

Although a client 160 may connect to any of the database nodes 110, itcould be sub-optimal to connect to one of them randomly, or in around-robin fashion, because the query's required tables or partitionsmay reside in a node 110 different from its connected execution node110. If a query's target database objects are located in a differentnode 110, then the query execution may need to involve node-to-nodecommunication through the network 120, which can be expensive in termsof the delay and resources involved. To minimize this mismatch betweenthe execution location and the data location, a number of strategies canbe used in the system 100.

Client-side routing is one strategy that can be used to reduce delay anduse of other resources. When a given query is compiled (e.g.prepareStatement( ) in the Java Database Connectivity (JDBC) API), itsdesired locations are cached at the database client library. The nextexecution of the compiled query (e.g. executePrepared( ) in JDBC) isthen, transparently for the application, routed, such as being directlyrouted, to one of the desired locations. If a query's target table ispartitioned and distributed, a single desired location of the querytypically cannot be decided at query compilation time, but it can bedecided at query execution time by evaluating the given argumentscorresponding to the table's partitioning specification.

While client-side statement routing is an approach that changes theexecution location to resolve the execution/data location mismatch, itis also possible to change the data location by moving tables orpartitions into a different location. The relocation may be triggered bythe database administrator or automatically by an advisor tool, such asbased on monitoring statistics of a given workload. Alternatively,tables can be co-partitioned in view of particular workload or databaseschemas in order to avoid expensive multi-node joins.

It is also possible to resolve the execution/data location mismatch byselectively replicating or caching tables/partitions. For example, if ajoin between two tables reflects a typical query pattern, replicating orcaching the less-update-intensive table, or the smaller table, or bothat a node, may improve system performance.

The disclosed distributed transaction protocol can provide strongtransaction consistency, which can be particularly useful forapplications where weakened consistency would not be desirable. In atleast some implementations, the disclosed transaction protocol cancomply with ACID properties and provide the same, or at leastsubstantially the same, transactional consistency independently ofwhether the underlying database is distributed or not.

Regarding the property isolation of the four properties in ACID, atleast some database environments of the present disclosure can provideone or both of two variants of snapshot isolation, statement-levelsnapshot isolation (SSI) and transaction-level snapshot isolation (TSI).Snapshot isolation provides non-blocking read access against anyconcurrent write transactions.

If a transaction consists of one or more statements (such as datamanipulation language, or DML, statements), which can be, for example,either of read and write (e.g. INSERT, UPDATE, or DELETE), in SSI, eachstatement reads data from a snapshot of the committed data at the timethe statement started. In TSI, each transaction reads data from asnapshot of the committed data at the time the transaction started,called the snapshot timestamp. In at least some database environments,SSI and TSI can co-exist, such as being configurable on a per userconnection. The definitions of SSI and TSI imply that data once read, ina statement or a transaction respectively, should be visible againwithin the same statement or transaction even though the data has beenchanged by a different concurrent transaction. For example, whenexecuting a join query with some predicate, the same record can bevisited multiple times within a single statement scope since theintermediate result of a query operator can be passed to the next queryoperator by a set of references to the filtered records (e.g. row IDs)without necessarily fully materializing them.

Although a Write Skew anomaly can happen under snapshot isolation, wheretwo transactions concurrently read overlapping data, make disjointupdates, and commit, it typically can be avoided in practice by usingSELECT FOR UPDATE properly in applications. Contrasted to otherconcurrency control options like optimistic concurrency control ortwo-phase locking, a benefit of snapshot isolation is that read queriescan proceed without any query abort or any lock waiting situation, eventhough they read a database object which is being changed by othertransactions.

In some implementations, the disclosed distributed transaction protocolcan have additional characteristics. For example, the protocol canprovide improved performance for both read-oriented workloads andread/write-mixed workloads. Although optimistic concurrency control canperform acceptably for some read-oriented workloads, it can lead to ahigh abort ratio for applications which generate concurrent read andwrite transactions.

Typically, in SSI and TSI, a snapshot timestamp is assigned to a newsnapshot when the new snapshot starts. Under SSI, each statement has itsown snapshot, while each transaction has its own snapshot under TSI. Thecost of the snapshot timestamp assignment operation typically becomesmore significant in SSI than in TSI, because the snapshot timestamp isassigned for each transaction under TSI, but for each statement underSSI. SSI thus offers more room for optimizations within the databasekernel, because it can be known which tables or partitions need to beaccessed in that particular snapshot scope by looking up the statement'squery plan before actually executing it.

Another characteristic is that the cost of transaction controloperations, such as snapshot timestamp assignment or transaction commit,may become more important for local statements/transactions thanmulti-node global statements/transactions due to their relative impacton overall performance. When a query touches tables distributed tomultiple nodes, the query's execution time involves the network cost ofexchanging the intermediate execution result of a node, thus theincrease in the transaction control operations could be relativelytrivial. However, if a query does not need to involve any networkinteraction for its own query processing, then a network roundtrip addedonly for the transaction control operation, for example, can affect theoverall performance significantly. Typically, a large fraction ofsimple, but highly concurrent, queries (as typically observed in OLTPapplications), run as single-node local queries. For example, in amulti-tenant database, tables can be partitioned reasonably well bytenant ID, leading naturally to node-local query execution.

In some aspects of the present disclosure, a database environmentincludes a table having database records. A new version of a record iscreated on each update operation instead of overriding the existingrecord version. Even for record deletion operations, a new versionheader is typically created with an empty payload instead of deletingthe existing record right away. When creating a new record version, aversioning token, such as a version timestamp, representing the versioncreation time, is stored, such as in a version header. In a particularimplementation, the version timestamp is derived from a globalsynchronization token, such as a transaction commit timestamp,maintained by a central transaction manager (which may be, for example,the coordinator node 140 of FIG. 1) which will be incremented on eachcommit of a write transaction. According to a particular example, theversions of a single record are chained to each other in a sorted order,such as by their version timestamps. Older versions in the version chaincan be garbage-collected when specified criteria are met, such as whenit is determined that there is no potential reader in the system forthat record version. In a particular implementation, there being nopotential reader in the system can be detected by maintaining a minimumvalue of snapshot timestamps of active snapshots in the system andcomparing it with the version timestamps of the garbage candidates.

When a query tries to read a record version, the visibility of therecord is checked by comparing the query's snapshot timestamp with theversion timestamp of the candidate record version. If the versiontimestamp of the record is higher than the snapshot timestamp of thequery, the particular record version should typically not be visible tothe query because the created version of the record was committed afterthe query started. Otherwise, if the version timestamp of the record isnot higher than the snapshot timestamp of the query, the record versionshould typically be visible to the query.

One potential issue in snapshot isolation implementation is updatingversion timestamps of multiple different rows in a transaction with thetransaction's assigned commit timestamp in an atomic way. At versioncreation time, the embracing version timestamp can typically becorrectly and finally set only after the embracing write transactionreceives its commit timestamp within the commit procedure. However, ifthe versions of the write transactions are updated with their committimestamp one by one, then some of those versions could be visible toanother snapshot while the others might still be invisible. Such anoutcome would not fully comply with the atomicity rule in the ACIDproperties.

To avoid this potential anomaly concerning visibility atomicity, atransaction context is maintained for each write transaction. When awrite transaction starts its first write operation, a transactioncontext entry is created. In a particular example, all created rowversions store a pointer to the transaction context entry in theirversion header field. At commit time, the transaction context entry isupdated with the write transaction's commit timestamp, and thus isavailable to the other versions through the pointer to the transactioncontext entry. After the transaction commit processing is completed, thecommit timestamp written in the transaction context entry isasynchronously propagated to the version timestamp fields. Thetransaction context entry may then be garbage-collected. With thisatomic indirect commit timestamp assignment to the created versions,visibility atomicity is still facilitated under this snapshot isolationimplementation.

FIG. 2 depicts an architecture 200 illustrating a transaction contextproviding version space management. The architecture 200 includes asnapshot timestamp store 210 that stores five active timestamps 12, 13,15, 16, and 19. Architecture 200 further includes a transaction contextstore 220 for four active write transactions, T1, T2, T3, T4, each withtheir own transaction context entry. A record store 230 chain storeholds three database records, Record 1, Record 2, and Record 3, eachwith own version chain of record versions 235. Each record version 235includes a version timestamp 240.

As shown, from the viewpoint of a snapshot whose snapshot timestamp is12, V₁₁ and V₂₁ are visible (because their version timestamps are lessthan the snapshot timestamp) but the other record versions 235 are not.V₁₃, V₂₂, and V₃₃ do not have their version timestamps yet, becausetheir write transactions are not yet committed. Under this transactionstate, the record versions 235 store a pointer 250 to the correspondingtransaction context entries (T₂ and T₃). Once T₂, for example, commits,then the transaction commit timestamp (19, as shown) of the transactionmanager 260 at that time is copied to the transaction context entry 220,thus providing visibility atomicity indirectly. Note that the datastructures in FIG. 2 are provided to give a conceptual overview, buttheir actual implementation can be different. For example, depending onwhether the corresponding table is a row store or a column store, bothof which may be supported in a single database system, the storagelayout of the record versions may be different.

Although read statements do not acquire locks in at least certainimplementations of the present disclosure, a write transaction typicallyacquires an exclusive lock of its updated record to ensure aserializable schedule of concurrent write operations. If the latestversion of the record is not visible to the snapshot after the exclusiverecord lock is acquired, then a transaction under TSI may throw an errorto the end user. A statement under SSI, however, may be configured torestart the statement by substituting its statement timestamp with anewer value of the transaction commit timestamp. In at least certainexamples, database objects are finally updated after lock acquisitionand validation. In further examples, lock tables are partitionedaccording to the location of their corresponding tables, or partitionedtogether with a multi-node deadlock detection implementation, to detectwhen dependencies between write operations carried out at differentnodes prevent transaction commitment.

Example 3—Distributed Snapshot Isolation

This Example 3 describes situations that can arise in distributedtransaction processing, and also describes aspects of the presentdisclosure that may be used in addressing such situations. Table 1provides a set of symbols that may be used to describe a distributedtransaction protocol.

TABLE 1 Notations Symbol Description CTS Transaction commit timestamp ofa transaction manager, incremented when a write transaction commits GCTCTS at the coordinator node LCT_(i) CTS at a worker node i CID(T_(i))Commit ID of a write transaction T_(i), assigned from GCT or LCT whenT_(i) commits pCID(T_(i)) Precommit ID of a write transaction T_(i),assigned from GCT or LCT when T_(i) pre- commits Status(T_(i)) Status ofa write transaction T_(i), either of {Unused, Active, Precommitted,Committed, Aborted} TID(T₁) Transaction identifier of a transactionT_(i) STS(Si) Snapshot timestamp of a snapshot S_(i), assigned from GCTor LCT when the snapshot (statement or transaction) starts

In at least certain implementations, the disclosed distributedtransaction protocol can provide the same level of transactionalconsistency regardless of how many nodes the database is partitionedinto. For example, a database environment may evolve from a single-nodesystem to a multi-node distributed system, such as to handle higherworkloads or larger database volumes. It may be undesirable for users tochange their own application logic and adapt it for a potentially weakerconsistency level provided by the database engine. This Example 3describes two consistency properties of distributed databaseenvironments that can be addressed by at least certain distributedtransaction protocols of the present disclosure.

According to the principle of visibility atomicity, a transaction'schanges should be visible to another concurrent snapshot in an atomicway: either completely visible or not. Achieving visibility atomicityunder snapshot isolation in a distributed database environment can bedifficult because the record versions created by a write transaction canbe distributed across worker nodes. For example, for a multi-node writetransaction, if each updated node is committed one by one, then thechanges of a node can be visible earlier to another concurrent reader,but others may not be visible to the same reader.

According to the principle of snapshot monotonicity, a transactionprotocol is said to ensure snapshot monotonicity if all of the followingconditions (visually represented in FIG. 3) are met for an arbitrarypair of write transactions, T_(i) and T_(j), and an arbitrary pair ofsnapshots, S_(p) and S_(q):

-   -   If T_(i)'s changes were visible to S_(q), and S_(q) was started        after S_(p)'s start, then T_(i)'s changes should be visible to        S_(p) as well (FIG. 3(a)).    -   If T_(j)'s changes were visible to S_(p), and T_(j) committed        after T_(i)'s commit, then T_(i)'s changes should be visible to        S_(p) as well (FIG. 3(b)).

Snapshot monotonicity is not represented by traditional ACID propertydefinitions. However, it is a feature that may be appreciated by users.For example, assume a SalesOrder processing component in a businessapplication inserted a record into a database table Tab1 by using atransaction T₁, and then it notified the event to aSupplyAvailabilityCheck processing component via a messaging protocolinside an application server after T₁ is committed. TheSupplyAvailabilityCheck processing component then inserts a new recordinto a table Tab2 by using another transaction T₂. Then, it will beexpected that the inserted record by SalesOrder processing (into Tab1 byT₁) should be visible to an analytic query which joins the tables Tab1and Tab2 if the inserted record by SupplyAvailabilityCheck processing(into Tab2 by T₂) was visible to the join query.

Although previous approaches have sought to address the desiredtransaction consistency requirements, they typically suffer fromdisadvantages, as will be described. One approach is to use a centralcoordinator node for processing all types of transaction events to helpensure full coordination of transactions. Whenever a write transactioncommits at the coordinator, or any of the worker nodes, it increments aglobal transaction commit timestamp maintained by the centraltransaction coordinator. Every snapshot starting at any worker node alsoacquires its snapshot timestamp by accessing the coordinator node. Thus,all multi-node and single-node transactions and snapshots aresynchronized by the central coordinator node.

In this approach, even single-node local queries, which can be executedat a single worker node, require a network round trip to the coordinatornode. In terms of performance, it is typically not desirable because thequery's latency increases and the coordinator node may become apotential bottleneck with a large number of worker nodes.

As another potential solution, in a vectorized approach, a fullylocalized transaction model may be used where every worker node has itsown local transaction manager and each local transaction managermaintains its own local commit timestamp (LCT). Whenever a writetransaction commits, it increments its transaction manager's localcommit timestamp. Starting a local snapshot at a worker node, a snapshottimestamp (STS) is acquired from the local transaction commit timestampof the worker node. When a multi-node snapshot starts, it collectssnapshot timestamps from the worker nodes that it can potentially accessduring its snapshot and carries the collected snapshot timestamp in avector during its query execution.

This approach can impose a significant performance penalty on multi-nodequeries. First, the cost of a multi-node access query is high becausesnapshot timestamps from multiple worker nodes that the query canpotentially access during its snapshot are collected. If the workernodes to be accessed are not known a priori, this cost becomes evenhigher because the query may need to collect the snapshot timestampsfrom all available worker nodes.

Second, acquiring snapshot timestamps from query target nodes should beatomic against any concurrent write transactions, and thus even the readoperation may lead to expensive synchronization across multiple nodes.An example of such a situation is illustrated by the system 400 shown inFIG. 4. System 400 includes a first node 410 having an executiontimeline 415 and a second node 420 having an execution timeline 425.Node 410 has an initial local commit timestamp of 10, while node 420 hasa local commit timestamp of 20.

A multi-node query, S₁, accesses tables at node 410 and node 420. Atprocess block 430, when S₁ accesses node 410, the query is assigned ashapshot ID, such as a timestamp, from the LCT maintained by node 410.In this case, the STS assigned by 410 is 10.

A write transaction T₁ accesses tables maintained at node 410 and node420. When the write transaction executes on node 410, at process block435, LCT₁ increments to 11, which is also the value assigned to thecommit ID (CID) for T₁ at node 410. When write transaction T₁ executesat node 420, at block 440, LCT₂ increments to 21, which is also thevalue assigned to the CID for T₂ at node 420. After execution at nodes410, 420, T₁ has a vector that includes the CIDs obtained from eachnode: {11, 21}. Query S₁ then executes on node 420 at process block 445.

Note that S₁ executes before T₁ on node 410, but after T₁ on node 420.Thus, while S₁ has a vector of {10, 21}, T₁ has a vector of {11, 21}. Ifthere is no synchronization during the step of collecting snapshottimestamps from nodes 410, 420, a part (changes at node 420) of a writetransaction T₁ is visible to a multi-node query S₁ (STS(S₁), as 21 ishigher than or equal to CID(T₁), 21 at node 420). However, the changesat node 410 are not visible to S₁, as the snapshot timestamp S₁ at node410, 10, is less than the commit ID of T₁, 11 at node 410. As the writeoperations within a transaction should be either all visible or all notvisibility, this scenario violates visibility atomicity.

The incremental snapshot timestamp scheme is an optimized variant of thevectorized approach. The incremental snapshot timestamp scheme does notacquire the snapshot timestamps when a snapshot starts, but ratheracquires them on demand incrementally. In this approach, the visibilityatomicity issue described in conjunction with FIG. 4 can be moreproblematic because of a wider time gap between the snapshot timestampacquisition at node 410 and snapshot timestamp acquisition at node 420for a query which accesses both of them.

To attempt to resolve this visibility atomicity issue, the incrementalapproach maintains a mapping between consistent snapshot timestampvalues of different worker nodes by requiring that every multi-nodewrite transaction update the mapping information. The representation ofthe mapping information is simplified by using the global committimestamp, which is incremented on every multi-node write transaction'scommit so that the mapping information contains only a pair of a globalsnapshot timestamp value and a local snapshot timestamp value. Althoughthis approach can help address the visibility atomicity issue discussedin conjunction with FIG. 4, it can have undesirable features.

For example, the existence of multi-node write transactions adds highcost to a system which has many concurrent, local read queries, becausethe multi-node write transaction accesses all running local snapshots toupdate its mapping information between the global snapshot timestamp andits local snapshot timestamp. In addition, snapshot monotonicity is notfully ensured because local write transactions are not synchronized witheach other at all.

FIG. 5 illustrates a system 500 that is similar to the system 400 ofFIG. 4. System 500 includes a first node 510 having an executiontimeline 515 and a second node 520 having an execution timeline 525. Aquery S₁ accesses nodes 510 and 520. S₁ acquires a snapshot ID, such asa timestamp, from node 510 in process 530. Node 510 has an initial LCT₁value of 10, which is assigned as the STS of S₁ at node 510. A localwrite transaction T₁ executes on node 510, at block 535, after thesearch acquires its STS from LCT₁. The LCT of node 510 increments from10 to 11 in block 535, which value is assigned as the commit ID of T₁ onnode 510.

Node 520 has an initial LCT₂ value of 20. Write transaction T₂ executeson node 520 at block 540, incrementing the LCT of node 520 to 21, whichvalue is assigned as the commit ID of T₂ on node 520. In block 545, S₁acquires a snapshot ID from node 520, and is assigned a STS of 21. Thus,local write transaction T₂ executes on node 520 before the searchacquires its STS from LCT₂.

As seen in FIG. 5, T₁'s change will not be visible to S₁, as the STS of10 for S₁ is less than the CID of 11 for T₁. However, because S₁acquires a STS of 21 from node 520, and that is equal to or greater thanthe CID for T₂, 21, on node 520, T₂'s change will be visible to S₁. So,as described above, in the particular case that T₂ was committed afterT₁ with some implicit causal dependency at the application server side,it violates the requirement of snapshot monotonicity, even if it doesnot violate visibility atomicity (because there are two different, localwrite operations, rather than a single, multi-node transaction as inFIG. 4). If the causal dependency between two local transactions isexplicitly exposed to the database engine (e.g. in case of a trigger),it may be possible to capture such dependencies automatically andinterpret the two local transactions as a single global transaction.However, it typically cannot be expected that all the causaldependencies of two different local transactions are explicitly exposedby the application server.

The incremental STS assignment technique also may lead to a visibilityanomaly under existing version garbage collection, or potentially a highperformance penalty in avoiding the anomaly and providing correctversion garbage collection. As opposed to the vectorized approach, whichcollects the needed snapshot timestamps at the time of snapshot start,the incremental snapshot assignment approach accesses the execution nodelater than its start time. Since non-local nodes are not aware of suchmulti-node queries, the versions needed for the query might already havebeen already garbage-collected. In this case, even though the rightlocal snapshot timestamp is assigned, the needed versions may no longerbe available, and thus the query may abort.

Yet another potential drawback of the incremental approach is thepossibility of multi-node queries being aborted due to a mismatch oflocal mapping information among the nodes accessed by a query. This isbecause, in some cases, a given global snapshot timestamp cannot bealways correctly translated to the correct local snapshot timestamp.

In at least certain implementations, the disclosed distributedtransaction protocol can provide transaction consistency equivalent to asingle-node system, or a multi-node setup under the full coordinationmodel, including visibility atomicity and snapshot monotonicity, withoutadding a significant performance penalty. In specific implementations,the disclosed distributed transaction protocol maintains a local committimestamp for each worker node and also maintains a global committimestamp. The global commit timestamp is synchronized with the localcommit timestamps whenever a multi-node write transaction commits, aswell as when a local write transaction commits Thus, all writetransactions, including local write transactions, are ordered.

The disclosed protocol, in some aspects, includes a synchronous networkround trip for each local write transaction. At least certain examplesof the disclosed protocol optimize this network synchronization. Forexample, the latency overhead may be almost hidden by overlapping thenetwork I/O with the log persistency I/O used for the commit operation.For durability, even local write transactions typically write redo logsand flush them to a persistent storage synchronously before finishingthe commit In addition, network I/O requests from concurrent writetransactions may be grouped together and collectively sent through asingle network roundtrip, which can help reduce any impact onperformance throughput.

For visibility atomicity of multi-node write transactions, certainaspects of the present disclosure provide a delayed visibility decisionscheme that employs an in-doubt visibility state of record versions. Thevisibility in-doubt state means that the write transaction of the targetrecord versions started its commit processing but is not yet finished.Under this state, the visibility to a given snapshot is not immediatelydecided, but postponed until the transaction state is marked ascommitted. The in-doubt state results in the sub-operations beingeffectively atomic without relying on any latch or lock.

Example 4—Snapshot Management

This Example 4 describes how a snapshot timestamp (STS) is assigned to asnapshot (a statement under SSI or a transaction under TSI), how the STSis used for a visibility decision by the snapshot, and how the garbageversions are detected based on STS values. Although this Example 4generally describes the protocol being used with SSI, the protocol canbe applied in other contexts, including under TSI.

FIG. 6 illustrates a system 600 illustrating how a STS is assigned to alocal statement. The system 600 includes a coordinator node 610 with anexecution timeline 615 and a worker node 620 with an execution line 625.When a statement, S_(i), starts in block 630, it gets its STS from itslocal synchronization token (such as a local commit timestamp (LCT))maintained at worker node 620, not from the global synchronization token(such as a global commit timestamp (GCT)) maintained by the coordinatornode 610. This is possible because the LCT of the worker node 620 issynchronized with the GCT maintained by the coordinator node 610whenever a write transaction commits in the worker node 620. Throughoutthe statement execution, block 640, the same STS value is used todetermine the visibility of a candidate record version. At operation650, the worker node 620 returns query results to the database clientwhich initiated the query.

FIG. 7 illustrates a system 700 depicting STS assignment of a multi-nodestatement executable at worker nodes 720, 730 having respectiveexecution timelines 725, 735. Execution of the statement S_(i) isfacilitated by a coordinator node 710 having an execution timeline 715.To provide visibility atomicity across multiple worker nodes 720, 730,the statement timestamp is acquired at worker node 720 from thecoordinator node 710 by the worker node 720 sending aStartGlobalSnapshot request 740 to the coordinator node 710 for a globalsynchronization token maintained by the coordinator node. The STS(corresponding to the synchronization token, such as the GCT) assignedby the coordinator node 710 is sent to the worker node 720 incommunication 745 and can be used for transactional access to any node,because all the worker-side transaction commit operations inform thecoordinator node 710 synchronously during their commit operations.

In at least certain implementations of the present disclosure,“maintaining” a token includes generating the token and assumingresponsibility for the correctness of the token. For example, acoordinator node may be responsible for generating a global timestampand incrementing it as appropriate to reflect the correct state of adatabase system. “Sending a token” or “receiving a token,” in at leastcertain implementations, refers to sending or receiving, respectively,the current value of the token.

In particular implementations of the systems of FIGS. 6 and 7, thesnapshot ID is an integer, such as an eight byte integer. In a specificexample, the snapshot ID is derived from, or the same as, the LCT(which, if the node 410 is a coordinator node, is the global committimestamp (GCT)).

After receiving the STS, the STS is assigned to the statement S_(i) inblock 750, which then executes in block 755. The statement S_(i) carriesthe assigned STS, such as in communication 760, when it needs to beexecuted in another worker node, such as worker node 730, throughout itsstatement execution (as shown in block 765 for worker node 730). At theend of the statement execution, such as in return block 770 of executiontimeline 725, an asynchronous request is made to the coordinator node710 by the worker node 720 using EndGlobalSnapshot request 775, whichcan be used, for example, for garbage collection purposes.

Making a synchronous network I/O to the coordinator to receive theglobal STS adds an additional cost (in both time and resources) for amulti-node statement. As previously mentioned, this cost can beminimized by grouping the requests from concurrent global queries into asingle network call, as explained further with reference to FIG. 12.However, since the multi-node statement itself already generates largernetwork traffic than getting a single STS value, the extra cost imposedby the global STS is typically not significant.

Under SSI, it can be decided at the statement start time whether astatement will use the local STS or the global STS. Using client-sidestatement routing, the target location information of a compiled queryis already maintained. Before query execution, it can be determinedwhether the query will access only a single node or multiple nodesretrieved from a pre-compiled query plan. For queries whose targetlocation cannot be determined at query compilation time (e.g. a queryfor a partitioned table not containing the partitioning key in its WHEREclause), in a particular implementation, the query is optimisticallyclassified as a local query. If this decision turns out to be notcorrect, the query can be re-started by substituting the STS with thecurrent GCT. Under SSI, such query restart can be done withoutnecessarily returning any error to the client application.

Under TSI, a database environment operating an implementation of thedisclosed distributed transaction protocol may be configured to mostlyemploy the global snapshot timestamp, as it may not be certain whichtypes of statements will be executed within the transaction's lifecycle. However, for cases where the transaction boundary is notparticularly short, any performance penalty coming from access to theglobal STS is typically not significant because the global STS istypically accessed under TSI only when the transaction starts, not forevery statement. In case of pre-compiled stored procedures, it can bedetected earlier even under TSI whether the procedure will make a localexecution or a multi-node execution by looking up the query plans of thestatements to be executed in the procedure.

If node 620 fails while the query is executed in the scenario of FIG. 6,then the query is automatically aborted as the node 620 is restarted. Inthe scenario of FIG. 7, if node 730 fails while the query is executed atnode 720, the query is restarted or aborted because the record versionscorresponding to the query's assigned global STS might not be availableany more in the restarted node 730. This case can be detected bymaintaining a per-node watermark at each worker node 720, 730, which isincremented whenever the corresponding worker node 720, 730 isrestarted. In a specific example, the watermark is a token, such as aninteger. After a worker node is restarted, its watermark value is alsocached at the coordinator node 710, and then the set of availableper-node watermark values are transmitted jointly to a global query whenthe query gets the global STS value from the coordinator node.Therefore, in at least certain implementations of the discloseddistributed transaction protocol, the communication 745 from thecoordinator node 710 to the worker node 720 includes at least the GCTand the watermark tokens cached at the coordinator node. Whenever theexecution of a global query is shipped to a new worker node 720, 730, itis checked whether the worker node has the same watermark value as thequery's informed watermark value.

Algorithm 1 shows how a statement checks if a record version V should bevisible or not to a snapshot S (a statement under SSI or a transactionunder TSI). For the visibility decision, first, V's creatortransaction's state is checked. If it is aborted or active, then Vshould not be visible to S (lines 8 to 11). If it is committed, then V'sCID is compared to STS(S). V is visible to S only if STS(S) is equal toor larger than V's CID (lines 3-7).

Algorithm 1 Visibility decision algorithm: check if a record version Vshould be visible to a snapshot S or not  1: while TRUE do  2: if V'sstatus is Committed then  3: if V's CID ≤ STS(S) then  4: return TRUE 5:  else  6: return FALSE  7: end if  8: else if V's status is Abortedthen  9:  return FALSE 10: else if V's status is Active then 11:  returnFALSE 12: else if V's status is Precommitted then 13: if V's pCID ≥STS(S) then 14: return FALSE 15:  else 16:   wait until V's statusbecomes Committed or   Aborted 17: end if 18: end if 19: end while

In addition to the basic visibility rules, the following extensions areprovided. As previously mentioned, and as recited in Algorithm 1, atleast certain implementations provide a statement or transaction statusof being precommitted, where the final commitment of the statement ortransaction is treated as in-doubt, with the visibility decision beingdelayed until the in-doubt status has been resolved, such as by thestatement or transaction being committed. If V's status is precommitted(lines 12 to 17), the corresponding record version's visibility decisionis postponed. The precommitted/in-doubt state makes sub-operations of atransaction commit effectively atomic without relying on any latch orlock.

The delayed visibility decision scheme may result in a situation where aread statement may need to wait for another write transaction's committo be completed. However, this waiting situation is typically uncommon,because it happens when a read statement is trying to check thevisibility of a record version which was created by a write transactioncommitted at the same time as the read attempt. To further reduce thepossibility of a reader waiting for an in-doubt transaction to complete,particular implementations of the disclosed transaction managementprotocol can include early pruning of record versions that will never bevisible.

As explained above, the in-doubt period of a transaction is started bysetting the transaction's state as precommitted. By assigning pCID,which is typically defined to be smaller than its CID value to bedecided later, at the time when the transaction state is set asprecommitted, record versions which will never be visible to the pendingreader statement, such as because the query was started later than thewrite operations and thus should only view records that were availablewhen the query was started, can be pruned. More specifically, if STS(S)is smaller than or equal to pCID(T) for a write transaction T and asnapshot S, then STS(S) will also be smaller than CID(T) because pCID(T)is smaller than CID(T) assigned by the commit protocol. Thus, ifSTS(S)≤pCID(T), it can be determined that the tested version V is notvisible to S (lines 13 to 14 of Algorithm 1) without waiting anyfurther.

In at least certain implementations of the present disclosure, garbagecollection is executed independently in each worker node, but itconsiders not only the queries running in its local node, but alsomulti-node queries which were started at different worker nodes but canpotentially access the local node. In order to reflect such globalqueries during local garbage collection, the coordinator node maintainsall the active global queries by watching the incomingStartGlobalSnapshot calls and EndGlobalSnapshot calls. When localgarbage collection starts at a worker node, it gets the minimum STSvalue of active global queries, called MinActiveGlobalSTS, from thecoordinator node, and also the minimum STS value of its active localqueries, called minActiveLocalSTS, from its local node. Taking theminimum value of MinActiveGlobalSTS and MinActiveLocalSTS, the garbagecollector finds out the record versions that have version timestampswhich are smaller than the minimum value by traversing the recordversion chains.

To maintain the complete set of active global queries at thecoordinator, StartGlobalSnapshot should typically be executedsynchronously from a worker node to the coordinator node. However, sinceStartGlobalSnapshot is already used to get the global STS of a globalquery, it does not add additional latency to the global query. Inparticular implementations of the disclosed method, the overhead ofEndGlobalSnapshot is minimized by making it as an asynchronous call, asshown in FIG. 7. Although the asynchronous call can result in theMinActiveGlobalSTS value being slightly out of date, which can result inslightly delayed garbage collection, it does not typically otherwiseaffect the overall performance of transaction processing.

FIG. 8A presents a flowchart of a method 800 summarizing actionsoccurring at a coordinator node during an embodiment of the presentdisclosure facilitating snapshot isolation. In step 805, the coordinatornode receives a request for a global commit ID, such as a global committimestamp, maintained by the coordinator node. The coordinator node maysend additional synchronization tokens, such as a watermark value cachedat the coordinator node and associated with the status of the workernode, to the worker node.

The coordinator node starts a global snapshot associated with therequest in step 810 and sends the global commit ID (and, optionally, theadditional synchronization tokens, such as a watermark) to the workernode in step 815. In step 820, the coordinator node receives anotification from the worker node, such as asynchronously, to end theglobal snapshot associated with the request. The coordinator node endsthe global snapshot associated with the request in step 825.

FIG. 8B presents a flowchart of a method 840 summarizing actionsoccurring at a first worker node during an embodiment of the presentdisclosure facilitating snapshot isolation. In step 845, the firstworker node sends a request to the coordinator node to begin a globalsnapshot. The first worker node receives a response from the coordinatornode, including a global synchronization token (such as a global commitID, such as a GCT), in step 850. The first worker node may request andreceive additional synchronization tokens, such as a watermark valuecached by the coordinator node and associated with the status of thefirst or second worker nodes. The first worker node assigns the GCT tothe snapshot as a snapshot ID in step 855. In step 860, the first workernode executes the snapshot. The first worker node, in step 865, sendsthe snapshot ID to a second worker node. The second worker node mayexecute the snapshot using the snapshot ID obtained from the firstworker node. The first worker node sends a request to the coordinatornode to end the global snapshot, such as asynchronously, in step 870.

Example 5—Transaction Commit

This Example 5 describes a transaction commit protocol according to anembodiment of the present disclosure, which may have differentimplementations depending on the write transaction type. Commitprotocols according to the embodiment of the present disclosure have acommon set of sub-operations (Table 2) and employ the same orderingrules among those sub-operations (FIG. 9).

TABLE 2 Sub-operations of transaction commit ID DescriptionSetAsPrepared Set the transaction's status as precommitted IncrementCTSIncrement GCT or LCT depending on where it commits AssignCID Assign thetransaction its CID value and associate it with the transaction'screated record versions WriteCommitLog Write the transaction's commitlog to persistent storage SetAsCommitted Set the transaction's status ascommitted ReleaseLocks Release all the write locks acquired by thetransaction Return Acknowledge the completion of the transaction'scommit to the client which requested it

A write transaction's status becomes precommitted by SetAsPrepared untilSetAsCommitted is called later for the transaction. As previouslymentioned, this in-doubt state can be used by the delayed visibilitydecision scheme to help ensure the atomicity of IncrementCTS andAssignCID of a write transaction without relying on any latching orlocking during transaction commit processing. When IncrementCTS iscalled, GCT or LCT is incremented depending on which type of node itcommits Based on the new GCT or LCT value, the transaction's CID isdecided at AssignCID. When WriteCommitLog is called, the writetransaction generates a commit log entry and writes it to persistentstorage, then calls SetAsCommitted that sets the transaction's status ascommitted, and then calls ReleaseLocks, which releases all the writelocks acquired by the transaction. If SetAsCommitted is finished, thewrite transaction's created record versions can be potentially visibleto other readers. If ReleaseLocks is finished, then the writetransaction's changed records can be potentially changed again by otherwriters. Note that, following the multi-version concurrency controlapproach, a write operation of a transaction acquires a write lock onthe changed record, but read operations do not acquire any lock.Finally, at Return, the transaction's commit is acknowledged to theclient which requested it.

Among those suboperations, a predefined execution order is typicallymaintained to help ensure transactional consistency, which is shown inFIG. 9. For operation boxes 905, 910, 915, 920, 925, 930, 935, arrows940, 945, 950, 955, 960, 965, 970, 975, 980, 985 indicate that theoperation at the tail end of the arrow should be executed before theoperation at the head of the arrow.

The execution order 975, between WriteCommitLog 920 and SetAsCommitted925, and the execution order 980 between WriteCommitLog 920 and Return930, should typically be maintained in order to help provide snapshotmonotonicity. Otherwise, snapshot monotonicity may not occur, becauseonce visible data might not be visible any more after crash restart.Execution order 985, between WriteCommitLog 920 and ReleaseLocks 935,should also typically be maintained, as it provides two-phase locking.Otherwise, uncommitted data can be changed again by another transaction,potentially leading to a cascaded rollback problem.

Without maintaining execution order 960, between AssignCID 910 andSetAsCommitted 925, a record version that should be visible to a querymay not be visible because the CID assignment to the record version isnot yet finished. Without execution order 965, between IncrementCTS 915and SetAsCommited 925, and execution order 970, between IncrementCTS 915and Return 930, commit-marked or commit-informed data might not bevisible even to its next query of the same session because the nextquery may start with a smaller snapshot timestamp value than thepreviously committed transaction's CID value.

Execution order 955, between IncrementCTS 915 and AssignCID 910, alsohelps provide snapshot isolation. For example, if IncrementCTS 915 isperformed after AssignCID 910, a query that started before a writetransaction T1's IncrementCTS 915 operation could see T1's changes laterbecause the STS value assigned to the query could be identical to T1'sCID value. SetAsPrepared 905 should typically be executed beforeWriteCommitLog 920 (transaction order 950) as well as beforeIncrementCTS 915 and AssignCID 910 (execution orders 945 and 940,respectively), since these two suboperations should be made effectivefor other transactions in an atomic way. For example, if IncrementCTS915 is completed, but AssignCID 910 is not yet finished for a writetransaction T1, then a different reader statement S1 can haveSTS(S1)>=CID(T1). However, since T1 does not yet have any CID, S1 caninterpret T1's created versions as invisible but suddenly they willbecome visible when T1 finishes AssignCID, which will violate snapshotisolation.

FIG. 10 depicts a system 1000 illustrating how a write transactioncommits when it has updated only the tables in a coordinator node 1010having an execution timeline 1015. The GCT is available locally in thisscenario. The suboperations of the transaction commit are ordered as:SetAsPrepared 1020, WriteCommitLog 1030, Increment-CTS and AssignCID,1040, SetAsCommitted and ReleaseLocks 1050, and Return 1060, which meetsthe ordering structure shown in FIG. 9.

FIG. 11 depicts a system 1100 having a coordinator node 1105 and aworker node 1115, with respective execution timelines 1110, 1120,illustrating how a write transaction commits when it has updated thetables located at the single worker node 1115. The worker node 1115synchronizes its LCT with the GCT maintained by the coordinator node1105. Thus, even local-only write transactions of different nodes areordered by GCT, which can help provide snapshot monotonicity.

In FIG. 11, execution timeline 1120 of worker node 1115 begins bysetting transaction T_(i) as prepared, or precommitted, in SetAsPreparedblock 1125. Worker node 1115 then makes a call 1130 to increment asynchronization token (such as the CTS) at the coordinator node 1105(which is a global synchronization token, such as the GCT) and assign asynchronization token (such as a CID) for T_(i) at the coordinator node1105 in process block 1135. The GCT increment operation (call 1130,IncrementCTS and AssignCID 1135, and return communication 1140 with theassigned CID for T_(i)) is called in parallel with the WriteCommitLogprocess 1145 at worker node 1115, where the log is written to persistentstorage 1150.

Since WriteCommitLog 1145 involves synchronous persistency I/O fortransaction durability, overlapping the network I/O with the logpersistency I/O can substantially hide the cost of the newly addednetwork I/O operation. Although overlapping the network I/O with thepersistency I/O can help reduce the transaction commit latency, theoverall throughput can be eventually bound by the network bandwidth ofthe coordinator node 1105. Thus, in particular examples of the discloseddistributed transaction protocol, the network calls initiated fromconcurrent transactions are grouped and coalesced to a single networkcall, like the group commit operation for log persistency I/O. Thecommit log entry of the single-node write transaction at the worker node1115 is written to the local log volume 1150 of the worker node 1115without making any additional round trip to the coordinator node 1105.During recovery of the worker node 1115, node-local write transactioncommits can be decided by the worker node 1115 without coordination orcommunication with the coordinator node 1105.

The IncrementCTS (the LCT of worker node 1115) and AssignCID operationsin process block 1155 use the results of the GCT increment in block1135, incrementing the CTS (LCT of node 1115) as shown. As discussedabove, the GCT increment operation 1135 involves a synchronous networkround trip between the worker node 1115 and the coordinator node 1105.

In case the network operation with the coordinator 1105 node, needed forIncrementCTS and AssignCID in operation 1155, fails, while the logpersistency I/O succeeds in block 1145, the network operation 1130 isretried until the coordinator node 1105 becomes available again to theworker node 1115. If the worker node 1115 crashes while in this retrystate, the transaction is simply committed during restart of the workernode 1115 and then LCT_(i)=++GCT is performed at the end of the restartphase of worker node 1115. Similarly, if the log persistency I/O failsin block 1145 while the network operations 1130, 1140 succeed, theworker node 1115 can proceed to the next operation only after the logpersistency I/O operation is successfully retried.

After the transaction is assigned a CID in block 1155, the transactionis marked as committed in process 1160. Any write locks acquired atworker node 1115 for the transaction are also released in block 1160. Inprocess 1170, the transaction is acknowledged as completed to thedatabase client (not shown) that initiated T_(i).

With the delayed visibility decision scheme shown in FIG. 11, using theprecommit of block 1125, a global statement S1 starting at timepoint t1(1190) will not see T₁'s change immediately at the timepoint t1. But,later, as soon as T_(i) finishes SetAsCommitted, T_(i)'s change will bevisible to S1. In this way, without adding any additional lock orsynchronization among write transactions, the GCT and LCT incrementoperations become effectively atomic to other concurrent readers.

FIG. 12 provides an architecture 1200 illustrating how network calls ata worker node 1210 may be grouped and coalesced to a single network callto a coordinator node 1220. The worker node 1210 includes a plurality oftransactions 1225, T₁-T_(n). The transactions 1225 send communicationrequests for the worker node 1220 to a sender side of a transactiongroup communicator 1230. The communication requests from the worker node1210 are sent by the sender side of the group communicator 1230 to areceiver side of a transaction group communicator 1235 maintained at thecoordinator node 1220. The receiver side transaction group communicator1235 mediates concurrent access to one or more synchronization tokens,(such as the GCT or cached watermark values) 1240 maintained by thecoordinator node 1220, which assigns synchronization tokens (such asCIDs) to the transactions and increments the synchronization tokens(such as the GCT) as appropriate. The assigned synchronization tokens(such as CIDs) are returned to the sender side transaction groupcommunicator 1230. As network requests are enqueued at the sender sidetransaction group communicator 1230, an additional delay may beintroduced, but it is typically trivial in most cases compared to thelatency needed for communication with the coordinator node 1220.

A transaction group logger 1240 at the worker node 1210 mediates groupcommit access to logging I/O requests to persistent storage 1245

FIG. 13 presents a system 1300 that is a modified version of the system500 of FIG. 5, adapted to the system 1100 of FIG. 11, illustrating howan embodiment of the disclosed distributed transaction protocol canprovide snapshot monotonicity. Worker nodes 1310, 1320, with respectiveexecution timelines 1315, 1325, have initial GCT values of 30 becauseevery local write transaction increments GCT in at least certainimplementations of the disclosed distributed transaction protocol.Assuming the initial GCT value is 30, S₁ will start with STS(S₁)=30 inprocess 1330. Subsequently, write transaction T₁ executed in processblock 1335 at worker node 1310, will increment GCT to 31 and setCID(T₁)=31 at node 1310.

Write transaction T₂ executed at worker node 1320 in process 1340 willincrement GCT to 32 and set CID(T₂)=32. Thus, both of T₁ and T₂'schanges, with respective CIDs of 31 and 32, will not be visible to S₁,which carries with it the initially assigned STS of 30 when it executesat node 1320 at process 1345, which is less than the CIDs of T₁ and T₂.

FIG. 14 presents a system 1400 having a coordinator node 1406 and workernodes 1412, 1416, with respective execution timelines 1408, 1414, 1418.The system 1400 illustrates how a write transaction commits after havingupdated the tables located in more than a single worker node 1412, 1416.To help provide durable atomicity of changes in multiple nodes 1406,1412, 1416, the system 1400 employs a two-phase commit approach. Thecommit log of the coordinator node 1406 is written only after theprecommit log entries of the transaction are safely written topersistent storage at all of the worker nodes 1412, 1416 changed by thetransaction.

The commit protocol begins in block 1424, where the coordinator node1406 sends communications 1426 to the worker nodes 1412, 1416 to preparethe worker nodes for the transaction commit. For example, thecoordinator node 1406 may send the communications 1426 in response to arequest by a database client (not shown) to commit the transaction. Thecommunications 1426, in a particular example, include a TransactionIDfor the transaction to be committed. In precommit blocks 1430, eachworker node 1412, 1416 executes SetAsPrepared to precommit thetransaction, assigning the transaction the LCT currently maintained atthe worker node. The worker nodes 1412, 1416 then write the transactionto persistent storage 1434, such as in a precommit log, in block 1432,flushing the pending redo logs of the transaction. The worker nodes1412, 1416 then communicate with the coordinator node 1402, vianotifications 1436, indicating that the transaction has beenprecommitted at the worker nodes and confirming to the coordinator aboutthe commit readiness of the worker nodes.

When the coordinator node 1406 receives the notifications 1436, inprocess block 1440, the coordinator node precommits the transaction,assigning the transaction a pCID equal to the current GCT maintained bythe coordinator node. The coordinator node 1406 also increments the CTS(which is also the GCT, in this case, using IncrementCTS), and assignsthe incremented CTS to the transaction as the CID (using AssignCID).Once the coordinator node 1406 has precommitted the transaction,including assigning the CID, the coordinator node sends communications1446 to the worker nodes 1412, 1416 indicating the precommitment andassociated CID. The worker nodes 1412, 1416 then execute process blocks1450, in which they increment their locally maintained LCT value (suchas using IncrementCTS). In a particular example, the worker nodes 1412,1416 select as the new LCT value the larger of the current LCT valuemaintained at the worker node and the CID for the transaction receivedfrom the coordinator node 1406 in communication 1446. The worker nodes1412, 1416 then assign the new LCT value as the CID for the transaction.Each worker node 1412, 1416, after completing block 1450, sends acommunication 1456 to the coordinator node 1406, indicating that thetransaction was successfully assigned a new CID at the worker nodes.While the communications 1446, and the increment and assign functions ofblocks 1450, are being carried out, the coordinator node 1406 writes thecommit to persistent storage 1454 in block 1452 (using WriteCommitLog,for example), such as to a commit log.

When the persistency operation 1452 has completed, and the coordinatornode 1406 has received the communications 1456 from each of the workernodes 1412, 1416, the coordinator node marks the transaction ascommitted and releases the write locks on the record, such as usingSetAsCommitted and ReleaseLocks, in process block 1460. The completionof the transaction is acknowledged by the coordinator node 1406 to theclient that initiated the transaction (not shown) in block 1462 (such asusing the Return operation).

The coordinator node 1406 sends communications 1466 to the worker nodes1412, 1416, such as asynchronously, that the transaction has beencommitted by the coordinator node. When the worker nodes 1412, 1416receive the communication 1466, the worker nodes commit the transactionand release their record write locks in process 1470. The transactioncommit is then written by the worker nodes 1412, 1416 to persistentstorage 1474, such as a commit log, in process block 1472.

As explained above, the process used in system 1400 involves severalcommunications between the coordinator node 1406 and the worker nodes1412, 1416. To reduce potential performance impacts from thesecommunications, such as network round trips, during commit processing,the second round trip (communications 1446 and 1456) is overlapped bythe log persistency I/O and the third trip (which does not need to be around trip, in at least some examples) is carried out asynchronouslyafter the transaction's commit is acknowledged to the client in process1462. In terms of transaction latency, only the first round trip, usedto help provide durable atomicity for multi-node write transactions,presents an added latency cost. In terms of transaction processingthroughput, the network cost is reduced, in some examples, by groupingand coalescing the network I/O requests made by concurrent writetransactions (such as described with reference to FIG. 12). Byacknowledging the commit earlier in the commit process, without waitingfor the final commitment of the transaction by the worker nodes 1412,1416 in process blocks 1470, 1472, the next operation of the samesession might encounter a tentative lock conflict if the next operationtries to update the same record updated by the previous writetransaction. In at least some implementations, the tentative conflictshould not produce any unexpected behavior for end users, because thelock wait time period will typically be short compared to common locktimeout values. Following the ordering 900 of FIG. 9, in at least someimplementations, the second round trip (1446, 1456), is not skipped orcoalesced with the third communication (1466), because the IncrementCTSoperation should be carried out before the Return operation.

The multi-node write transaction commit process described in FIG. 14also takes advantage of the delayed visibility decision scheme duringthe in-doubt period for visibility atomicity across changes distributedto multiple nodes. One difference between FIG. 14 and FIG. 8 is that thecoordinator node 1406 additionally has an in-doubt period so that it candecide the write transaction's CID value earlier and the network I/O forCID propagation (communication 1446) can be overlapped by the logpersistency I/O (1452) for WriteCommitLog at the coordinator node 1406.

The WriteCommitLog operations 1472 at the worker nodes 1412, 1416 can beinitiated after the Return operation 1462 at the coordinator node 1406.Even if a worker node 1412, 1416 crashes without having written itslocal commit log, the transaction can be detected as an in-doubttransaction during its restart and thus it can be committed again byreferring to the coordinator node 1406. If there is neither a precommitnor a commit log entry at a worker node 1412, 1416, then the transactioncan be rolled back at the worker node without asking the coordinatornode 1406. In case there is a failure during the WriteCommitLogoperation 1452 at the coordinator node 1406, or theAssignCID/IncrementCTS operations 1450 at the worker nodes 1412, 1416, afault handling similar to the one described for FIG. 8 is applied. Otherfault tolerance behavior is, in some examples, similar to othertwo-phase commit protocols.

Note that, in FIG. 14, as long as pCID(T) is smaller than CID(T) for awrite transaction T, the pCID values of a transaction at different nodesdo not need to have the same value, while CID values should beidentical, because the pCID values are used as a hint for earlyfiltering of false positive cases.

FIG. 15 depicts a system 1500 having two worker nodes 1510, 1520 withrespective execution timelines 1515, 1525, illustrating how at leastcertain implementations of the disclosed transaction protocol can helpresolve the visibility atomicity issue described in conjunction with thesystem 400 of FIG. 4. In FIG. 15, the initial GCT value will be 30 orhigher, because, according to the implementations, every local writetransaction increments GCT. Assuming the initial GCT value is 30, S₁will start with STS(S₁)=30 at block 1530. Then, T₁ will increment theGCT to 31 and set CID(T₁)=31 at both of node 1510 and node 1520 inprocesses 1535 and 1540. Therefore, T₁'s changes will not be visible toS₁ at neither node 1510 nor node 1520, as S₁ carries with it the STS of30 from node 1510 when executed on node 1520 at process 1545, and thatSTS is less than the CID of T₂.

FIG. 16A provides a flowchart of a method 1620 for facilitating databasetransaction processing within a database environment implemented, atleast in part, by a coordinator node that is in communication with aworker node. In step 1622, the coordinator node receives a precommitnotification from the worker node, the precommit notification beingassociated with a write operation at the worker node. The coordinatornode increments a global commit ID, such as a global commit timestamp,maintained by the coordinator node in step 1624. In step 1626, thecoordinator node assigns the incremented global commit ID as the commitID of the write operation. The coordinator node, in step 1628, sends thecommit ID for the write operation to the worker node.

FIG. 16B presents a flowchart of a method 1640 for facilitating databasetransaction processing within a database environment implemented, atleast in part, by a coordinator node. In step 1642, the coordinator nodestores a write log entry associated with a database operation. Thedatabase write operation is precommitted by the coordinator node in step1644. In step 1646, the coordinator node increments a global commit ID,such as a global commit timestamp, maintained by the coordinator node.The incremented global commit ID, in step 1648, is assigned as thecommit ID for the database write operation.

A flowchart of a method 1660 for facilitating database transactionprocessing within a database environment implemented, at least in part,by a first worker node in communication with at least a second workernode and a coordinator node, is illustrated in FIG. 16C. In step 1662,the first worker node precommits at least a portion of a multi-nodedatabase write operation. The first worker node stores a precommit logentry associated with the at least a portion of the multi-node databasewrite operation in step 1664. In step 1666, the first worker node sendsa precommit notification to the coordinator node and, in step 1668,receives a commit ID from the coordinator node associated with themulti-node write operation. An increment operation for a local commit IDmaintained by the first worker node is carried out in step 1670. Thefirst worker node assigns the local commit ID as the commit ID for themulti-node database write operation at the first worker node in step1672. In step 1674, the first worker node stores a write log entryassociated with the commitment of the multi-node database writeoperation at the first worker node.

Example 6—Computing Systems

FIG. 17 depicts a generalized example of a suitable computing system1700 in which the described innovations may be implemented. Thecomputing system 1700 is not intended to suggest any limitation as toscope of use or functionality of the present disclosure, as theinnovations may be implemented in diverse general-purpose orspecial-purpose computing systems.

With reference to FIG. 17, the computing system 1700 includes one ormore processing units 1710, 1715 and memory 1720, 1725. In FIG. 17, thisbasic configuration 1730 is included within a dashed line. Theprocessing units 1710, 1715 execute computer-executable instructions. Aprocessing unit can be a general-purpose central processing unit (CPU),processor in an application-specific integrated circuit (ASIC), or anyother type of processor. In a multi-processing system, multipleprocessing units execute computer-executable instructions to increaseprocessing power. For example, FIG. 17 shows a central processing unit1710 as well as a graphics processing unit or co-processing unit 1715.The tangible memory 1720, 1725 may be volatile memory (e.g., registers,cache, RAM), non-volatile memory (e.g., ROM, EEPROM, flash memory,etc.), or some combination of the two, accessible by the processingunit(s) 1710, 1715. The memory 1720, 1725 stores software 1780implementing one or more innovations described herein, in the form ofcomputer-executable instructions suitable for execution by theprocessing unit(s) 1710, 1715.

A computing system 1700 may have additional features. For example, thecomputing system 1700 includes storage 1740, one or more input devices1750, one or more output devices 1760, and one or more communicationconnections 1770. An interconnection mechanism (not shown) such as abus, controller, or network interconnects the components of thecomputing system 1700. Typically, operating system software (not shown)provides an operating environment for other software executing in thecomputing system 1700, and coordinates activities of the components ofthe computing system 1700.

The tangible storage 1740 may be removable or non-removable, andincludes magnetic disks, magnetic tapes or cassettes, CD-ROMs, DVDs, orany other medium which can be used to store information in anon-transitory way and which can be accessed within the computing system1700. The storage 1740 stores instructions for the software 1780implementing one or more innovations described herein.

The input device(s) 1750 may be a touch input device such as a keyboard,mouse, pen, or trackball, a voice input device, a scanning device, oranother device that provides input to the computing system 1700. Theoutput device(s) 1760 may be a display, printer, speaker, CD-writer, oranother device that provides output from the computing system 1700.

The communication connection(s) 1770 enable communication over acommunication medium to another computing entity. The communicationmedium conveys information such as computer-executable instructions,audio or video input or output, or other data in a modulated datasignal. A modulated data signal is a signal that has one or more of itscharacteristics set or changed in such a manner as to encode informationin the signal. By way of example, and not limitation, communicationmedia can use an electrical, optical, RF, or other carrier.

The innovations can be described in the general context ofcomputer-executable instructions, such as those included in programmodules, being executed in a computing system on a target real orvirtual processor. Generally, program modules include routines,programs, libraries, objects, classes, components, data structures, etc.that perform particular tasks or implement particular abstract datatypes. The functionality of the program modules may be combined or splitbetween program modules as desired in various embodiments.Computer-executable instructions for program modules may be executedwithin a local or distributed computing system.

The terms “system” and “device” are used interchangeably herein. Unlessthe context clearly indicates otherwise, neither term implies anylimitation on a type of computing system or computing device. Ingeneral, a computing system or computing device can be local ordistributed, and can include any combination of special-purpose hardwareand/or general-purpose hardware with software implementing thefunctionality described herein.

For the sake of presentation, the detailed description uses terms like“determine” and “use” to describe computer operations in a computingsystem. These terms are high-level abstractions for operations performedby a computer, and should not be confused with acts performed by a humanbeing. The actual computer operations corresponding to these terms varydepending on implementation.

Example 7—Cloud Computing Environment

FIG. 18 depicts an example cloud computing environment 1800 in which thedescribed technologies can be implemented. The cloud computingenvironment 1800 comprises cloud computing services 1810. The cloudcomputing services 1810 can comprise various types of cloud computingresources, such as computer servers, data storage repositories,networking resources, etc. The cloud computing services 1810 can becentrally located (e.g., provided by a data center of a business ororganization) or distributed (e.g., provided by various computingresources located at different locations, such as different data centersand/or located in different cities or countries).

The cloud computing services 1810 are utilized by various types ofcomputing devices (e.g., client computing devices), such as computingdevices 1820, 1822, and 1824. For example, the computing devices (e.g.,1820, 1822, and 1824) can be computers (e.g., desktop or laptopcomputers), mobile devices (e.g., tablet computers or smart phones), orother types of computing devices. For example, the computing devices(e.g., 1820, 1822, and 1824) can utilize the cloud computing services1810 to perform computing operators (e.g., data processing, datastorage, and the like).

Example 8—Features

Different embodiments may include one or more of the inventive featuresshown in the following table of features.

# Feature A. Global snapshot management by coordinator node withasynchronous end of global snapshot notification. A1 A method,implemented at least in part by a coordinator node comprising aprocessing unit and memory, the coordinator node being in communicationwith a worker node, for facilitating database transaction processingwithin a database environment, the method comprising: receiving arequest from the worker node for at least one global synchronizationtoken maintained by the coordinator node; starting a global snapshotassociated with the request; sending the at least one globalsynchronization token to the worker node; receiving a notification fromthe worker node to end the global snapshot associated with the request,the notification being sent asynchronously by the worker node such thatthe worker node continues processing without awaiting a reply to thenotification; and ending the global snapshot associated with therequest. A2 The method of claim A1, further comprising maintaining, atthe coordinator node, a set representing active global snapshots in thedatabase environment. A3 The method of claim A2, wherein starting theglobal snapshot associated with the request comprising adding the globalsnapshot to the set. A4 The method of claim A2, wherein ending theglobal snapshot associated with the request comprises removing theglobal snapshot from the set. A5 The method of claim A2, wherein eachglobal snapshot of the set is associated with a timestamp. A6 The methodof claim A5, further comprising maintaining a minimum active globaltimestamp value representing the oldest timestamp for the active globalsnapshots in the set. A7 The method of claim A6, further comprisingsending the minimum active global timestamp value to the worker node forversion garbage collection. A8 The method of claim A7, furthercomprising, at the worker node: determining a minimum active localtimestamp value; determining a minimum active timestamp value among theminimum active global timestamp value and the minimum active localtimestamp value; comparing a version timestamp of a database record withthe minimum active timestamp value; and maintaining the database recordif the version timestamp is greater than or equal to than the minimumactive timestamp value. A9 The method of claim A1, wherein receiving therequest and sending the at least one global synchronization token arecarried out synchronously such that the worker node blocks at least someoperations until receiving the at least one global synchronizationtoken. A10 The method of claim A1, further comprising, during executionof at least part of a query at the worker node, determining whether adatabase record is visible to the query, wherein the database record isvisible to the query if the database record has been committed and has acommit ID value that is less than or equal to a snapshot ID value, thesnapshot ID value being based at least in part on the at least oneglobal synchronization token. A11 The method of claim A10, wherein thecommit ID and snapshot ID values comprise timestamps. A12 The method ofclaim A10, wherein the commit ID value is an integer. A13 The method ofclaim A10, wherein the snapshot ID value comprises an integer. A14 Themethod of claim A1l, wherein the snapshot ID value and the commit IDvalue have the same value. A15 The method of claim A1, wherein thesnapshot ID value and the commit ID value have different values. A16 Themethod of claim A1, wherein the at least one global synchronizationtoken comprises an integer. A17 The method of claim A1, wherein the atleast one global synchronization token is an integer. A18 The method ofclaim A1, wherein the at least one global synchronization token is aglobal commit ID maintained by the coordinator node. A19 The method ofclaim A1, wherein the at least one global synchronization token is aglobal commit timestamp maintained by the coordinator node. A20 Themethod of claim A19, wherein the global commit timestamp is an integer.A21 The method of claim A1, further comprising, during execution of atleast part of a query at the worker node, determining whether a databaserecord is visible to the query by comparing a snapshot ID valueassociated with the global snapshot to a precommit ID associated withthe database record. A22 The method of claim A21, wherein the snapshotID value and the precommit ID value comprise timestamps. A23 The methodof claim A21, wherein the database record is not visible to the query ifsnapshot ID value is less than or equal to the precommit ID value. A24The method of claim A21, wherein if the snapshot ID value is greaterthan the precommit ID value, the determining whether the database recordis visible is postponed until the database record is committed oraborted. A25 The method of claim A1, wherein the request is associatedwith a data manipulation language statement for a query. A26 The methodof claim A1, wherein the request is associated with a transaction for aquery, the transaction comprising one or more of data manipulationlanguage statements. A27 The method of claim A1, wherein the at leastone global synchronization token comprises a timestamp. A28 The methodof claim A1, wherein the at least one global synchronization tokencomprises a watermark cached by the coordinator node and associated withstatus of the worker node. A29 The method of claim A1, wherein therequest from the worker node is received in a network communicationcomprising a plurality of requests for one or more additionalsynchronization tokens maintained by the coordinator node. B. Globalsnapshot management by coordinator node with worker node watermark. B1 Amethod, implemented at least in part by a coordinator node comprising aprocessing unit and memory, the coordinator node being in communicationwith a worker node, for facilitating database transaction processingwithin a database environment, the method comprising: receiving arequest from the worker node for at least first and secondsynchronization tokens maintained by the coordinator node; starting aglobal snapshot associated with the request; sending the at least firstand second synchronization tokens to the worker node, the secondsynchronization token comprising a watermark cached by the coordinatornode and associated with status of the worker node; receiving anotification from the worker node to end the global snapshot associatedwith the request; and ending the global snapshot associated with therequest. B2 The method of claim B1, further comprising maintaining, atthe coordinator node, a set representing active global snapshots in thedatabase environment. B3 The method of claim B2, wherein starting theglobal snapshot associated with the request comprising adding the globalsnapshot to the set. B4 The method of claim B2, wherein ending theglobal snapshot associated with the request comprises removing theglobal snapshot from the set. B5 The method of claim B2, wherein eachglobal snapshot of the set is associated with a timestamp. B6 The methodof claim B5, further comprising maintaining a minimum active globaltimestamp value representing the oldest timestamp for the active globalsnapshots in the set. B7 The method of claim B6, further comprisingsending the minimum active global timestamp value to the worker node forversion garbage collection. B8 The method of claim B7, furthercomprising, at the worker node: determining a minimum active localtimestamp value; determining a minimum active timestamp value among theminimum active global timestamp value and the minimum active localtimestamp value; comparing a version timestamp of a database record withthe minimum active timestamp value; and maintaining the database recordif the version timestamp is greater than or equal to than the minimumactive timestamp value. B9 The method of claim B1, wherein receiving therequest and sending the at least first and second synchronization tokensare carried out synchronously such that the worker node blocks at leastsome operations until receiving the first synchronization token. B10 Themethod of claim B1, further comprising, during execution of at leastpart of a query at the worker node, determining whether a databaserecord is visible to the query, wherein the database record is visibleto the query if the database record has been committed and has a commitID value that is less than or equal to a snapshot ID value, the snapshotID value being based at least in part on the first globalsynchronization token. B11 The method of claim B10, wherein the commitID and snapshot ID values comprise timestamps. B12 The method of claimB11, wherein the snapshot ID value is an integer. B13 The method ofclaim B11, wherein the snapshot ID value comprises an integer. B14 Themethod of claim B11, wherein the snapshot ID value and the commit IDvalue have the same value. B15 The method of claim B11, wherein thecommit ID value is an integer. B16 The method of claim B1, wherein thefirst synchronization token comprises an integer. B17 The method ofclaim B1, wherein the first synchronization token is an integer. B18 Themethod of claim B1, wherein the first synchronization token is a globalcommit ID maintained by the coordinator node. B19 The method of claimB1, wherein the first synchronization token is a global commit timestampmaintained by the coordinator node. B20 The method of claim B19, whereinthe global commit timestamp is an integer. B21 The method of claim B1,further comprising, during execution of at least part of a query at theworker node, determining whether a database record is visible to thequery by comparing a snapshot ID value associated with the globalsnapshot to a precommit ID associated with the database record. B22 Themethod of claim B21, wherein the snapshot ID value and the precommit IDvalue comprise timestamps. B23 The method of claim B21, wherein thedatabase record is not visible to the query if snapshot ID value is lessthan or equal to the precommit ID value. B24 The method of claim B21,wherein if the snapshot ID value is greater than the precommit ID value,the determining whether the database record is visible is postponeduntil the database record is committed or aborted. B25 The method ofclaim B1, wherein the request is associated with a data manipulationlanguage statement for a query. B26 The method of claim B1, wherein therequest is associated with a transaction for a query, the transactioncomprising one or more of data manipulation language statements. B27 Themethod of claim B1, wherein the first synchronization token comprises atimestamp. B28 The method of claim B1, wherein the notification to endthe global snapshot is sent asynchronously by the worker node such thatthe worker node continues processing without awaiting a reply to thenotification. B29 The method of claim B1, wherein the request from theworker node is received in a network communication from the worker nodecomprising a plurality of requests for one or more additionalsynchronization tokens maintained by the coordinator node. C.Interaction of worker node with coordinator node managing globalsnapshots and synchronization token providing access to first and secondworker nodes. C1 A method, implemented at least in part by a firstworker node comprising a processing unit and memory, the first workernode being in communication with a coordinator node and at least asecond worker node, for facilitating database transaction processingwithin a database environment, the method comprising: sending a requestto the coordinator node for at least a first synchronization tokenmaintained by the coordinator node; receiving the at least a firstsynchronization token from the coordinator node; assigning at least partof the at least a first synchronization token to a global snapshot as asnapshot ID value; executing at least part of a query that involves theglobal snapshot; and forwarding the snapshot ID value to the at least asecond worker node. C2 The method of claim C1, further comprising, whenexecuting the at least part of the query that involves the globalsnapshot, determining whether a database record is visible to the query,wherein the database record is visible to the query if the databaserecord has been committed and has a commit ID value that is less than orequal to the snapshot ID value. C3 The method of claim C2, wherein thecommit ID and snapshot ID values comprise timestamps. C4 The method ofclaim C1, further comprising, when executing the at least part of thequery that involves the global snapshot, determining whether a databaserecord is visible to the query by comparing the snapshot ID value to aprecommit ID value associated with the database record. C5 The method ofclaim C4, wherein the snapshot ID value and the precommit ID valuecomprise timestamps. C6 The method of claim C4, wherein the databaserecord is not visible to the query if the snapshot ID value is less thanor equal to the precommit ID value. C7 The method of claim C4, whereinif the snapshot ID value is greater than the precommit ID value, thedetermining whether the database record is visible is postponed untilthe database record is committed or aborted. C8 The method of claim C1,wherein the request is associated with a data manipulation languagestatement for the query. C9 The method of claim C1, wherein the requestis associated with a transaction for the query, the transactioncomprising one or more data manipulation language statements. C10 Themethod of claim C1, wherein the at least a first synchronization tokencomprises a global commit ID comprising a timestamp. C11 The method ofclaim C1, further comprising receiving from the coordinator node aminimum active global timestamp value representing an oldest timestampin a set of active global timestamps in the database environment. C12The method of claim C11, further comprising: determining a minimumactive local timestamp value; determining a minimum active timestampvalue among the minimum active global timestamp value and the minimumactive local timestamp value; comparing a version timestamp of adatabase record with the minimum active timestamp value; and deletingthe database record if the version timestamp is less than the minimumactive timestamp value. C13 The method of claim C1, wherein sending therequest for the at least a first synchronization token to thecoordinator node and receiving the at least a first synchronizationtoken from the coordinator node are carried out synchronously such thatthe first worker node blocks at least some operations until receivingthe at least a first synchronization token. C14 The method of claim C1,further comprising sending a notification to the coordinator node to endthe global snapshot. C15 The method of claim C14, wherein sending thenotification to the coordinator node to end a global snapshot is carriedout asynchronously such that the first worker node continues processingwithout awaiting a reply to the notification. C16 The method of claimC1, further comprising, executing the at least part of the query thatinvolves the global snapshot at the at least a second worker node. C17The method of claim C16, further comprising receiving execution resultsfrom the at least a second worker node at the first worker node. C18 Themethod of claim C16, further comprising, when executing the at leastpart of the query that involves the global snapshot at the a least asecond worker node, determining whether a database record is visible tothe query by comparing the snapshot ID value to a precommit ID valueassociated with the database record. C19 The method of claim C18,wherein the database record is not visible to the query if the snapshotID value is less than or equal to the precommit ID value. C20 The methodof claim C18, wherein if the snapshot ID value is greater than theprecommit ID value, the determining whether the database record isvisible is postponed until the database record is committed or aborted.C21 The method of claim C1, further comprising, at the first workernode, receiving the query from a client and returning query results tothe client. C22 The method of claim C1, wherein receiving the at least afirst synchronization token from the coordinator node comprisesreceiving a watermark value cached by the coordinator node andassociated with status of the first worker node, the method furthercomprising comparing the cached watermark value to a current watermarkvalue maintained by the first worker node. C23 The method of claim C22,further comprising aborting or restarting the query if the cachedwatermark value is less than the current watermark value maintained bythe first worker node. C24 The method of claim C1, wherein receiving theat least a first synchronization token from the coordinator nodecomprises receiving a watermark value cached by the coordinator node andassociated with status of the second worker node, the method furthercomprising comparing the cached watermark value to a current watermarkvalue maintained by the second worker node. C25 The method of claim C24,further comprising aborting or restarting the query if the cachedwatermark value is less than the current watermark value maintained bythe second worker node. C26 The method of claim C1, wherein the at leasta first synchronization token is a global commit ID maintained by thecoordinator node. C27 The method of claim C1, wherein the snapshot IDvalue consists of the at least a first synchronization token. C28 Themethod of claim C27, wherein the at least a first synchronization tokenconsists of a global commit ID maintained by the coordinator node. C29The method of claim C28, wherein the global commit ID consists of aglobal commit timestamp. C30 The method of claim C1, wherein thesnapshot ID value is or is derived from the at least part of the atleast a first synchronization token. C31 The method of claim C1, whereinsending the request to the coordinator node comprises grouping therequest in a network communication to the coordinator node along withone or more additional requests to the coordinator node for one or moreother synchronization tokens maintained by the coordinator node. C32 Themethod of claim C1, further comprising sending a notification to end theglobal snapshot to the coordinator node. C33 The method of claim C32,wherein the notification to end the global snapshot is sentasynchronously to the coordinator node such that the first worker nodecontinues processing without awaiting a reply to the notification. D.Interaction of worker node with coordinator node managing globalsnapshots with asynchronous end global snapshot notification. D1 Amethod, implemented at least in part by a worker node comprising aprocessing unit and memory, the worker node being in communication witha coordinator node, for facilitating database transaction processingwithin a database environment, the method comprising: sending a requestto the coordinator node for at least a first synchronization tokenmaintained by the coordinator node; receiving the at least a firstsynchronization token from the coordinator node; assigning at least partof the at least a first synchronization token to a global snapshot as asnapshot ID value; executing at least part of a query that involves theglobal snapshot; and sending a notification to the coordinator node toend the global snapshot, the notification being sent asynchronously suchthat the worker node continues processing without awaiting a reply tothe notification. D2 The method of claim D1, further comprising, whenexecuting the at least part of the query that involves the globalsnapshot, determining whether a database record is visible to the query,wherein the database record is visible to the query if the databaserecord has been committed and has a commit ID value that is less than orequal to the snapshot ID value. D3 The method of claim D2, wherein thecommit ID and snapshot ID values comprise timestamps. D4 The method ofclaim D1, further comprising, when executing the at least part of thequery that involves the global snapshot, determining whether a databaserecord is visible to the query by comparing the snapshot ID value to aprecommit ID value associated with the database record. D5 The method ofclaim D4, wherein the snapshot ID value and the precommit ID valuecomprise timestamps. D6 The method of claim D4, wherein the databaserecord is not visible to the query if the snapshot ID value is less thanor equal to the precommit ID value. D7 The method of claim D4, whereinif the snapshot ID value is greater than the precommit ID value, thedetermining whether the database record is visible is postponed untilthe database record is committed or aborted. D8 The method of claim D1,wherein the request is associated with a data manipulation languagestatement for the query. D9 The method of claim D1, wherein the requestis associated with a transaction for the query, the transactioncomprising one or more data manipulation language statements. D10 Themethod of claim D1, wherein the at least a first synchronization tokencomprises a global commit ID comprising a timestamp. D11 The method ofclaim D1, further comprising receiving from the coordinator node aminimum active global timestamp value representing an oldest timestampin a set of active global timestamps in the database environment. D12The method of claim D11, further comprising: determining a minimumactive local timestamp value; determining a minimum active timestampvalue among the minimum active global timestamp value and the minimumactive local timestamp value; comparing a version timestamp of adatabase record with the minimum active timestamp value; and a minimumactive local timestamp value maintained by the worker node and deletingthe database record if the version timestamp is less than the minimumactive timestamp value. D13 The method of claim D1, wherein sending therequest for the at least a first synchronization token to thecoordinator node and receiving the at least a first synchronizationtoken from the coordinator node are carried out synchronously such thatthe worker node blocks at least some operations until receiving the atleast a first synchronization token. D14 The method of claim D1, furthercomprising, at the first worker node, receiving the query from a clientand returning query results to the client. D15 The method of claim D1,wherein receiving the at least a first synchronization token from thecoordinator node comprises receiving a watermark value cached by thecoordinator node and associated with status of the worker node, themethod further comprising comparing the cached watermark value to acurrent watermark value maintained by the worker node. D16 The method ofclaim D15, further comprising aborting or restarting the query if thecached watermark value is less than the current watermark valuemaintained by the worker node. D17 The method of claim D1, wherein theat least a first synchronization token is a global commit ID maintainedby the coordinator node. D18 The method of claim D1, wherein thesnapshot ID value consists of the at least a first synchronizationtoken. D19 The method of claim D18, wherein the at least a firstsynchronization token consists of a global commit ID maintained by thecoordinator node. D20 The method of claim D19, wherein the global commitID consists of a global commit timestamp. D21 The method of claim D1,wherein the snapshot ID is or is derived from the at least part of theat least a first synchronization token. D22 The method of claim D1,wherein sending the request to the coordinator node comprises groupingthe request in a network communication to the coordinator node alongwith one or more additional requests to the coordinator node for one ormore other synchronization tokens maintained by the coordinator node. E.Interaction of worker node with coordinator node managing globalsnapshots with worker node status watermark. E1 A method, implemented atleast in part by a worker node comprising a processing unit and memory,the worker node being in communication with a coordinator node, forfacilitating database transaction processing within a databaseenvironment, the method comprising: sending a request to the coordinatornode for a first synchronization token and at least a secondsynchronization token maintained by the coordinator node, the at least asecond synchronization token representing a watermark value cached atthe coordinator node and associated with status of the worker node;receiving the first and at least a second synchronization tokens fromthe coordinator node; comparing at least part of the at least a secondsynchronization token with a current watermark value maintained by theworker node; and executing at least part of a query that involves aglobal snapshot. E2 The method of claim E1, further comprising assigningthe first synchronization token to the global snapshot as a snapshot IDvalue. E3 The method of claim E1, further comprising, when executing theat least part of the query that involves the global snapshot,determining whether a database record is visible to the query, whereinthe database record is visible to the query if the database record hasbeen committed and has a commit ID value that is less than or equal to asnapshot ID value. E4 The method of claim E3, wherein the commit ID andsnapshot ID values comprise timestamps. E5 The method of claim E1,further comprising, when executing the at least part of the query thatinvolves the global snapshot, determining whether a database record isvisible to the query by comparing a snapshot ID value to a precommit IDassociated with the database record. E6 The method of claim E5, whereinthe snapshot ID value and the precommit ID value comprise timestamps. E7The method of claim E5, wherein the database record is not visible tothe query if the snapshot ID value is less than or equal to theprecommit ID value. E8 The method of claim E5, wherein, if the snapshotID value is greater than the precommit ID value, the determining whetherthe database record is visible is postponed until the database record iscommitted or aborted. E9 The method of claim E1, wherein the request isassociated with a data manipulation language statement for the query.E10 The method of claim E1, wherein the request is associated with atransaction for the query, the transaction comprising one or more datamanipulation language statements. E11 The method of claim E1, whereinthe first synchronization token comprises a global commit ID comprisinga timestamp. E12 The method of claim E1, further comprising receivingfrom the coordinator node a minimum active global timestamp valuerepresenting an oldest timestamp in a set of active global timestamps inthe database environment. E13 The method of claim E12, furthercomprising: determining a minimum active local timestamp value;determining a minimum active timestamp value among the minimum activeglobal timestamp value and the minimum active local timestamp value;comparing a version timestamp of a database record with the minimumactive timestamp value and a minimum active local timestamp valuemaintained by the worker node and deleting the database record if theversion timestamp is less than the minimum active timestamp value. E14The method of claim E1, wherein sending the request for the firstsynchronization token and the at least a second synchronization token tothe coordinator node and receiving the first synchronization token andthe at least a second synchronization token from the coordinator nodeare carried out synchronously such that the first worker node blocks atleast some operations until receiving the first synchronization token.E15 The method of claim E1, further comprising, at the first workernode, receiving the query from a client and returning query results tothe client. E16 The method of claim E1, further comprising aborting orrestarting the query if the at least part of the at least a secondsynchronization token is less than the current watermark valuemaintained by the worker node. E17 The method of claim E1, wherein thefirst synchronization token is a global commit ID maintained by thecoordinator node. E18 The method of claim E2, wherein the snapshot IDvalue consists of the at least a first synchronization token. E19 Themethod of claim E18, wherein the first synchronization token consists ofa global commit ID maintained by the coordinator node. E20 The method ofclaim E19, wherein the global commit ID consists of a global committimestamp. E21 The method of claim E2, wherein the snapshot ID value isor is derived from the at least part of the first synchronization token.E22 The method of claim E1, further comprising sending a notification tothe coordinator node to end the global snapshot. E23 The method of claimE22, wherein sending the notification to the coordinator node to end theglobal snapshot is carried out asynchronously such that the first workernode continues processing without awaiting a reply to the notification.E24 The method of claim E1, wherein sending the request to thecoordinator node comprises grouping the request in a networkcommunication to the coordinator node along with one or more additionalrequests to the coordinator node for one or more other synchronizationtokens maintained by the coordinator node. F. Interaction of worker nodewith coordinator node and assigning synchronization token as snapshotID. F1 A method, implemented at least in part by a worker nodecomprising a processing unit and memory, the worker node being incommunication with a coordinator node, for facilitating databasetransaction processing within a database environment, the methodcomprising: sending a request to the coordinator node for asynchronization token; receiving the synchronization token from thecoordinator node; assigning at least part of the synchronization tokento a global snapshot as a snapshot ID value; and executing at least partof a query that involves the global snapshot. F2 The method of claim F1,wherein the snapshot ID value consists of the synchronization token. F3The method of claim F1, wherein the synchronization token consists of aglobal commit ID. F4 The method of claim F1, wherein the synchronizationtoken consists of a global commit timestamp F5 The method of claims F3or F4 wherein the snapshot ID value consists of the synchronizationtoken. F6 The method of claim F1, wherein sending the request to thecoordinator node comprises grouping the request in a networkcommunication to the coordinator node along with one or more additionalrequests to the coordinator node for one or more other synchronizationtokens maintained by the coordinator node. F7 The method of claim F1,wherein the synchronization token consists of an integer. F8 The methodof claim F7, wherein the integer is an eight byte integer G. Transactioncommit operations at coordinator node incrementing synchronization tokenon transaction commit by worker node. G1 A method, implemented at leastin part by a coordinator node comprising a processing unit and memory,the coordinator node being in communication with at least a first workernode, for facilitating database transaction processing within a databaseenvironment, the method comprising: receiving a precommit notificationassociated with a database write operation from the at least a firstworker node, the database write operation being a local write operationat the at least a first worker node; incrementing a synchronizationtoken maintained by the coordinator node; assigning the incrementedsynchronization token as a commit ID for the database write operation;and sending the commit ID for the database write operation to the atleast a first worker node. G2 The method of claim G1, wherein thesynchronization token is a global commit ID. G3 The method of claim G1,wherein the synchronization token is a global commit timestamp. G4 Themethod of claim G1, the method further comprising receiving a precommitnotification associated with a multi-node database write operation fromthe at least a first worker node, receiving a precommit notificationassociated with the multi- node database write operation from anotherworker node among the at least a first worker node, incrementing thesynchronization token maintained by the coordinator node, and storing acommit write log entry associated with the multi-node database writeoperation. G5 The method of claim G4, further comprising designating themulti-node write operation as committed. G6 The method of claim G5,further comprising sending a commit notification to the at least a firstworker node, indicating the commitment of the multi-node database writeoperation by the coordinator node. G7 The method of claim G6, whereinsending the commit notification to the at least a first worker node iscarried out asynchronously such that the coordinator node continuesprocessing without awaiting a reply to the notification from the atleast a first worker node. G8 The method of claim G6, wherein sendingthe commit notification to the at least a first worker node is carriedout asynchronously such that the coordinator node continues processingwithout awaiting a reply to the notification from at least a secondworker node. G9 The method of claim G6, further comprising releasingwrite locks associated with the multi-node database write operation. G10The method of claim G1, wherein the database write operation isspecified with a data manipulation language statement. G11 The method ofclaim G1, wherein the database write operation is part of a transaction,the transaction comprising one or more data manipulation languagestatements. G12 The method of claim G4, further comprising receiving anotification from the at least a first worker node regarding a commit IDassigned by the at least a first worker node to the multi-node databasewrite operation. G13 The method of claim G12, wherein storing a commitwrite log entry associated with the multi-node database write operationis performed between sending the commit ID to the worker node andreceiving the notification from the at least a first worker noderegarding the commit ID assigned by the at least a first worker node.G14 The method of claim G1, wherein the precommit notification from theworker node is received in a network communication comprising aplurality of precommit notifications for the worker node. H. Transactioncommit operations at worker node updating synchronization token atcoordinator node. H1 A method, implemented at least in part by a workernode comprising a processing unit and memory, the worker node being incommunication with a coordinator node, for facilitating databasetransaction processing within a database environment, the methodcomprising: precommitting a local database write operation; sending arequest to the coordinator node to increment a global synchronizationtoken maintained by the coordinator node; receiving an incrementedglobal synchronization token from the coordinator node; and performingan increment operation on a local synchronization token maintained bythe worker node; and assigning a commit ID to the local database writeoperation. H2 The method of claim H1, further comprising storing thelocal database write operation in persistent storage after sending therequest to the coordinator node to increment the global synchronizationtoken. H3 The method of claim H1, further comprising receiving at leastpart of a query at the worker node and, if the at least part of thequery can be executed locally at the worker node, assigning as asnapshot ID value the local synchronization token maintained by theworker node. H4 The method of claim H1, further comprising receiving atleast part of a query at the worker node and, if the at least part ofthe query is a multi-node statement or transaction, sending a request tothe coordinator node to start a global snapshot. H5 The method of claimH1, wherein the database write operation is specified with a datamanipulation language statement. H6 The method of claim H1, wherein thedatabase write operation is part of a transaction, the transactioncomprising one or more data manipulation language statements. H7 Themethod of claim H1, wherein the global synchronization token comprises aglobal commit ID. H8 The method of claim H1, wherein the globalsynchronization token comprises a global commit timestamp. H9 The methodof claim H1, wherein the local synchronization token comprises a localcommit ID. H10 The method of claim H9, wherein the local synchronizationtoken comprises a local commit timestamp. H11 The method of claim H1,wherein sending the request to the coordinator node comprises groupingthe request in a network communication to the coordinator node alongwith one or more additional requests to the coordinator node for one ormore other synchronization tokens maintained by the coordinator node. I.Transaction commit operations at worker node for multi-node writeoperation. I1 A method, implemented at least in part by a first workernode comprising a processing unit and memory, the first worker nodebeing in communication with a coordinator node and at least a secondworker node, for facilitating database transaction processing within adatabase environment, the method comprising: precommitting at least aportion of a multi-node database write operation; storing a precommitlog entry associated with the at least a portion of the multi-nodedatabase write operation; sending a precommit notification to thecoordinator node; receiving from the coordinator node a global commit IDassociated with the multi-node database write operation; incrementing,if appropriate, a local commit ID maintained by the first worker node;sending the local commit ID to the coordinator node; assigning the localcommit ID as a commit ID for the multi-node database write operation;and storing a write log entry associated with the commitment of themulti-node database write operation. I2 The method of claim I1, furthercomprising receiving a commit notification from the coordinator nodedesignating the multi- node database write operation as committed at thecoordinator node. I3 The method of claim I2, wherein receiving thecommit notification from the coordinator node designating the multi-node database write operation as committed at the coordinator node isasynchronous such that the coordinator node continues processing withoutawaiting a reply to the commit notification from the first worker node.I4 The method of claim I3, wherein storing a write log entry associatedwith the commitment of the multi-node database write operation occursafter receiving the commit notification from the coordinator nodedesignating the multi-node database write operation as committed at thecoordinator node. I5 The method of claim I2, wherein storing a write logentry associated with the commitment of the multi-node database writeoperation occurs after receiving the commit notification from thecoordinator node designating the multi-node database write operation ascommitted at the coordinator node. I6 The method of claim I1, furthercomprising, at the first worker node, comprising designating themulti-node write operation as committed. I7 The method of claim I6,wherein designating the multi-node write transaction as committed at thefirst worker node is asynchronous such that the first worker nodecontinues processing without regard to the commitment of the multi-nodewrite transaction at the coordinator node. I8 The method of claim I1,further comprising releasing record write locks associated with themulti-node database write operation on the first worker node. I9 Themethod of claim I1, wherein storing a write log entry associated withcommitment of the multi-node database write transaction occursasynchronously such that the first worker node continues processingwithout regard to commitment of the multi-node write transaction at thecoordinator node and the at least a second worker node. I10 The methodof claim I1, wherein incrementing the local commit ID maintained by thefirst worker node comprising selecting maximum of the global commit IDassociated with the multi- node database write operation received fromthe coordinator node and a current value of the local commit IDmaintained by the first worker node. I11 The method of claim I1, whereinthe at least a second worker node also performs the precommitting,storing a precommit log entry, sending, receiving, incrementing,assigning, and storing a write log entry. I12 The method of claim I1,wherein sending the precommit notification to the coordinator nodecomprises grouping the precommit notification in a network communicationto the coordinator node along with one or more additional precommitnotifications to the coordinator node. J. Grouped network communicationat worker node. J1 A method, implemented at least in part by a workernode comprising a processing unit and memory, the worker node being incommunication with a coordinator node, for facilitating databasetransaction processing within a database environment, the methodcomprising: receiving, for a plurality of database operations, aplurality of requests for a synchronization token maintained by thecoordinator node; grouping the plurality of requests into a networkcommunication; sending the network communication to the coordinatornode; receiving a network communication from the coordinator nodecomprising one or more synchronization tokens associated with theplurality of requests; and associating the one or more synchronizationtokens with the plurality of database operations. J2 The method of claimJ1, wherein each of the one or more synchronization tokens comprises aglobal commit ID maintained by the coordinator node. J3 The method ofclaim J1, wherein each of the one or more synchronization tokenscomprises a global commit timestamp maintained by the coordinator node.J4 The method of claim J1, wherein associating the one or moresynchronization tokens with the plurality of database operationscomprises using at least one of the one or more synchronization tokensto assign a snapshot ID value to at least one of the plurality ofdatabase operations. J5 The method of claim J1, wherein associating theone or more synchronization tokens with the plurality of databaseoperations comprises using at least one of the one or moresynchronization tokens to assign a commit ID value to at least one ofthe plurality of database operations. J6 The method of claim J5, furthercomprising: sending a plurality of commit requests to a transactiongroup logger; grouping the plurality of commit requests into a singleI/O communication; and sending the I/O communication to a storagedevice. K. Grouped network request at coordinator node. K1 A method,implemented at least in part by a coordinator node comprising aprocessing unit and memory, the coordinator node being in communicationwith a worker node, for facilitating database transaction processingwithin a database environment, the method comprising: receiving from theworker node a first network communication requesting one or moresynchronization tokens for a plurality of requests associated with aplurality of database operations maintained by the coordinator node;associating the one or more synchronization tokens with the plurality ofdatabase operations; grouping synchronization tokens responsive to theplurality of requests into a second network communication; and sendingthe second network communication to the worker node. K2 The method ofclaim K1, further comprising incrementing at least one of thesynchronization tokens maintained by the coordinator node in response toat least one of the plurality of requests. K3 The method of claim K1,wherein each of the synchronization tokens comprises a global committimestamp maintained by the coordinator node. K4 The method of claim K1,wherein each of the synchronization tokens comprises a global commit IDmaintained by the coordinator node. L. Grouped write log operation atworker node. L1 A method, implemented at least in part by a worker nodecomprising a processing unit and memory, the worker node being incommunication with a coordinator node, for facilitating databasetransaction processing within a database environment, the methodcomprising: receiving, for a plurality of database operations, aplurality of requests to store information related to the plurality ofdatabase operations in persistent storage; grouping the plurality ofrequests into an I/O communication; and sending the I/O communication toa storage device M. Ordering of commitment suboperations. M1 A method,implemented at least in part by a worker node and/or a coordinator node,each of the worker node and the coordinator node comprising a processingunit and memory, the worker node being in communication with thecoordinator node, for committing a database write operation, the methodcomprising: (a) precommitting the operation; (b) incrementing a committimestamp; (c) assigning a commit ID to the operation; (d) writing theoperation to a commit log; (e) marking the operation as committed; (f)indicating to a client that the operation has been completed; and (g)releasing write locks associated with the operation; wherein step (a)occurs before steps (b)-(g), steps (b)-(d) occur before steps (e), steps(b) and (d) occur before step (f), step (d) occurs before step (g), andstep (b) occurs before step (c).

Example 9—Implementations

Although the operations of some of the disclosed methods are describedin a particular, sequential order for convenient presentation, it shouldbe understood that this

manner of description encompasses rearrangement, unless a particularordering is required by specific language set forth below. For example,operations described sequentially may in some cases be rearranged orperformed concurrently. Moreover, for the sake of simplicity, theattached figures may not show the various ways in which the disclosedmethods can be used in conjunction with other methods.

Any of the disclosed methods can be implemented as computer-executableinstructions or a computer program product stored on one or morecomputer-readable storage media and executed on a computing device(e.g., any available computing device, including smart phones or othermobile devices that include computing hardware). Tangiblecomputer-readable storage media are any available tangible media thatcan be accessed within a computing environment (e.g., one or moreoptical media discs such as DVD or CD, volatile memory components (suchas DRAM or SRAM), or nonvolatile memory components (such as flash memoryor hard drives)). By way of example and with reference to FIG. 17,computer-readable storage media include memory 1720 and 1725, andstorage 1740. The term computer-readable storage media does not includesignals and carrier waves. In addition, the term computer-readablestorage media does not include communication connections (e.g., 1770).

Any of the computer-executable instructions for implementing thedisclosed techniques as well as any data created and used duringimplementation of the disclosed embodiments can be stored on one or morecomputer-readable storage media. The computer-executable instructionscan be part of, for example, a dedicated software application or asoftware application that is accessed or downloaded via a web browser orother software application (such as a remote computing application).Such software can be executed, for example, on a single local computer(e.g., any suitable commercially available computer) or in a networkenvironment (e.g., via the Internet, a wide-area network, a local-areanetwork, a client-server network (such as a cloud computing network), orother such network) using one or more network computers.

For clarity, only certain selected aspects of the software-basedimplementations are described. Other details that are well known in theart are omitted. For example, it should be understood that the disclosedtechnology is not limited to any specific computer language or program.For instance, the disclosed technology can be implemented by softwarewritten in C++, Java, Perl, JavaScript, Adobe Flash, or any othersuitable programming language. Likewise, the disclosed technology is notlimited to any particular computer or type of hardware. Certain detailsof suitable computers and hardware are well known and need not be setforth in detail in this disclosure.

Furthermore, any of the software-based embodiments (comprising, forexample, computer-executable instructions for causing a computer toperform any of the disclosed methods) can be uploaded, downloaded, orremotely accessed through a suitable communication means. Such suitablecommunication means include, for example, the Internet, the World WideWeb, an intranet, software applications, cable (including fiber opticcable), magnetic communications, electromagnetic communications(including RF, microwave, and infrared communications), electroniccommunications, or other such communication means.

The disclosed methods, apparatus, and systems should not be construed aslimiting in any way. Instead, the present disclosure is directed towardall novel and nonobvious features and aspects of the various disclosedembodiments, alone and in various combinations and sub combinations withone another. The disclosed methods, apparatus, and systems are notlimited to any specific aspect or feature or combination thereof, nor dothe disclosed embodiments require that any one or more specificadvantages be present or problems be solved.

The technologies from any example can be combined with the technologiesdescribed in any one or more of the other examples. In view of the manypossible embodiments to which the principles of the disclosed technologymay be applied, it should be recognized that the illustrated embodimentsare examples of the disclosed technology and should not be taken as alimitation on the scope of the disclosed technology. Rather, the scopeof the disclosed technology includes what is covered by the scope andspirit of the following claims.

What is claimed is:
 1. One or more tangible computer-readable storagemedia storing computer-executable instructions for causing a serverprogrammed thereby to perform operations for facilitating databasetransaction processing within a database environment and implementing afirst worker node of a database system, the first worker node being incommunication with a coordinator node and at least a second worker node,the operations comprising: sending a request to the coordinator node forat least a first synchronization token maintained by the coordinatornode, the at least a first synchronization token representing a mostrecent commit state known to at least the coordinator node; receivingthe at least a first synchronization token from the coordinator node;assigning at least part of the at least a first synchronization token toa global snapshot as a snapshot ID value; executing at least part of aquery that involves the global snapshot using the snapshot ID value, theexecuting comprising: accessing a record version of a database record;determining a commit ID associated with the record version of thedatabase record; comparing the commit ID with the snapshot ID value; andbased on the comparing, determining whether the record version of thedatabase record will be visible to the at least part of the query; andforwarding the snapshot ID value to the at least a second worker node,wherein the at least a second worker node executes at least part of thequery that involves the global snapshot using the snapshot ID value sentby the first worker node.
 2. The one or more tangible computer-readablestorage media of claim 1, wherein the record version of the databaserecord is visible to the at least part of the query if the recordversion of the database record has been committed and has a commit IDvalue that is less than or equal to the snapshot ID value.
 3. The one ormore tangible computer-readable storage media of claim 1, furthercomprising, when executing the at least part of the query that involvesthe global snapshot, determining whether the record version of thedatabase record is visible to the at least part of the query bycomparing the snapshot ID value to a precommit ID value associated withthe record version of the database record.
 4. The one or more tangiblecomputer-readable storage media of claim 1, further comprising executingthe at least part of the query at the at least the second worker nodeusing the snapshot ID value.
 5. The one or more tangiblecomputer-readable storage media of claim 1, wherein the at least a firstsynchronization token comprises a global commit ID comprising atimestamp.
 6. The one or more tangible computer-readable storage mediaof claim 1, wherein receiving the at least a first synchronization tokenfrom the coordinator node comprises receiving a watermark value cachedby the coordinator node and associated with status of the first workernode, the operations further comprising comparing the cached watermarkvalue to a current watermark value maintained by the first worker node.7. The one or more tangible computer-readable storage media of claim 6,further comprising aborting or restarting the at least part of the queryif the cached watermark value is less than the current watermark valuemaintained by the first worker node.
 8. The one or more tangiblecomputer-readable storage media of claim 1, wherein receiving the atleast a first synchronization token from the coordinator node comprisesreceiving a watermark value cached by the coordinator node andassociated with status of the at least the second worker node, theoperations further comprising comparing the cached watermark value to acurrent watermark value maintained by the at least the second workernode.
 9. The one or more tangible computer-readable storage media ofclaim 8, further comprising aborting or restarting the at least part ofthe query if the cached watermark value is less than the currentwatermark value maintained by the at least the second worker node. 10.The one or more tangible computer-readable storage media of claim 1,wherein the snapshot ID value is or is derived from the at least part ofthe at least a first synchronization token.
 11. The one or more tangiblecomputer-readable storage media of claim 1, further comprising sending anotification to end the global snapshot to the coordinator node.
 12. Theone or more tangible computer-readable storage media of claim 11,wherein the notification to end the global snapshot is sentasynchronously to the coordinator node such that the first worker nodecontinues processing without awaiting a reply to the notification. 13.The one or more tangible computer-readable storage media of claim 1,further comprising: precommitting at least a portion of a multi-nodedatabase write operation; storing a precommit log entry associated withthe at least a portion of the multi-node database write operation;sending a precommit notification to the coordinator node; receiving fromthe coordinator node a global commit ID associate with the multi-nodedatabase write operation; incrementing, if appropriate, a local commitID maintained by the first worker node; sending the local commit ID tothe coordinator node; assigning the local commit ID as a commit ID forthe multi-node database write operation; and storing a write log entryassociated with commitment of the multi-node database write operation.14. A computing device implementing a server, the computing devicecomprising one or more hardware processors and one or more memoriescoupled to the one or more hardware processors, the one or more memoriesstoring computer-executable instructions for causing the computingdevice to perform operations implementing a first worker node thatfacilitates database transaction processing within a databaseenvironment, the first worker node being in communication with acoordinator node and at least a second worker node, the operationscomprising: sending a request to the coordinator node for at least afirst synchronization token maintained by the coordinator node, the atleast a first synchronization token representing a most recent commitstate known to at least the coordinator node; receiving the at least afirst synchronization token from the coordinator node; assigning atleast part of the at least a first synchronization token to a globalsnapshot as a snapshot ID value; executing at least part of a query thatinvolves the global snapshot using the snapshot ID value, the executingcomprising: accessing a record version of a database record; determininga commit ID associated with the record version of the database record;comparing the commit ID with the snapshot ID value; and based on thecomparing, determining whether the record version of the database recordwill be visible to the at least part of the query; and forwarding thesnapshot ID value to the at least a second worker node, wherein the atleast a second worker node executes at least part of the query thatinvolves the global snapshot using the snapshot ID value sent by thefirst worker node.
 15. The computing device of claim 14, wherein therecord version of the database record is visible to the at least part ofthe query if the record version of the database record has beencommitted and has a commit ID value that is less than or equal to thesnapshot ID value.
 16. The computing device of claim 14, furthercomprising, when executing the at least part of the query that involvesthe global snapshot, determining whether the record version of thedatabase record is visible to the at least part of the query bycomparing the snapshot ID value to a precommit ID value associated withthe record version of the database record.
 17. The computing device ofclaim 14, further comprising executing the at least part of the query atthe at least a second worker node using the snapshot ID value.
 18. Thecomputing device of claim 14, wherein the at least a firstsynchronization token comprises a global commit ID comprising atimestamp.
 19. The computing device of claim 14, wherein receiving theat least a first synchronization token from the coordinator nodecomprises receiving a watermark value cached by the coordinator node andassociated with status of the first worker node, the operations furthercomprising comparing the cached watermark value to a current watermarkvalue maintained by the first worker node.
 20. The computing device ofclaim 19, further comprising aborting or restarting the at least part ofthe query if the cached watermark value is less than the currentwatermark value maintained by the first worker node.
 21. The computingdevice of claim 14, wherein receiving the at least a firstsynchronization token from the coordinator node comprises receiving awatermark value cached by the coordinator node and associated withstatus of the at least a second worker node, the operations furthercomprising comparing the cached watermark value to a current watermarkvalue maintained by the at least a second worker node.
 22. The computingdevice of claim 21, further comprising aborting or restarting the atleast part of the query if the cached watermark value is less than thecurrent watermark value maintained by the at least a second worker node.23. The computing device of claim 14, wherein the snapshot ID value isor is derived from the at least part of the at least a firstsynchronization token.
 24. The computing device of claim 14, furthercomprising sending a notification to end the global snapshot to thecoordinator node.
 25. The computing device of claim 24, wherein thenotification to end the global snapshot is sent asynchronously to thecoordinator node such that the first worker node continues processingwithout awaiting a reply to the notification.
 26. The computing deviceof claim 14, further comprising: precommitting at least a portion of amulti-node database write operation; storing a precommit log entryassociated with the at least a portion of the multi-node database writeoperation; sending a precommit notification to the coordinator node;receiving from the coordinator node a global commit ID associate withthe multi-node database write operation; incrementing, if appropriate, alocal commit ID maintained by the first worker node; sending the localcommit ID to the coordinator node; assigning the local commit ID as acommit ID for the multi-node database write operation; and storing awrite log entry associated with commitment of the multi-node databasewrite operation.
 27. A method, implemented by at least one computingdevice comprising at least one hardware processor and one or moretangible memories in communication with the at least one hardwareprocessor, the one or more tangible memories storing computer-executableinstructions for causing the at least one computing device to implementa coordinator node of a database system, the coordinator node being incommunication with a worker node, wherein the coordinator node isfurther configured to perform a method for facilitating databasetransaction processing within a database environment, the methodcomprising: receiving a request from the worker node for a globalsynchronization token maintained by the coordinator node, the globalsynchronization token representing a most recent commit state known toat least the coordinator node; starting a global snapshot associatedwith the request; sending at least one global synchronization token tothe worker node; receiving a notification from the worker node to endthe global snapshot associated with the request, the notification beingsent asynchronously by the worker node such that the worker nodecontinues processing without awaiting a reply to the notification;ending the global snapshot associated with the request; and removing theglobal snapshot from a list of active global snapshots, wherein the listof active global snapshots is useable to remove record versions that areno longer needed for an active query.
 28. The method of claim 27,wherein starting the global snapshot associated with the requestcomprises adding the global snapshot to the list of active globalsnapshots.
 29. The method of claim 27, wherein each global snapshot ofthe list of active global snapshots is associated with a timestamp. 30.The method of claim 29, further comprising: maintaining a minimum activeglobal timestamp value representing an oldest timestamp for the activeglobal snapshots in the list of active global snapshots.
 31. The methodof claim 30, further comprising: sending the minimum active globaltimestamp value to the worker node for version garbage collection. 32.The method of claim 27, wherein the requesting and sending the at leastone global synchronization token are carried out synchronously such thatthe worker node blocks at least some operations until receiving the atleast one global synchronization token.
 33. One or more tangiblecomputer-readable storage media storing computer-executable instructionsfor causing a computing device programmed thereby to implement acoordinator node that performs operations that facilitate databasetransaction processing within a database environment, the coordinatornode being in communication with a worker node, the operationscomprising: receiving a request from the worker node for a globalsynchronization token maintained by the coordinator node, the globalsynchronization token representing a most recent commit state known toat least the coordinator node; starting a global snapshot associatedwith the request; sending at least one global synchronization token tothe worker node; receiving a notification from the worker node to endthe global snapshot associated with the request, the notification beingsent asynchronously by the worker node such that the worker nodecontinues processing without awaiting a reply to the notification;ending the global snapshot associated with the request; and removing theglobal snapshot from a list of active global snapshots, wherein the listof active global snapshots is useable to remove record versions that areno longer needed for an active query.
 34. The one or more tangiblecomputer-readable storage media of claim 33, wherein starting the globalsnapshot associated with the request comprises adding the globalsnapshot to the list of active global snapshots.
 35. The one or moretangible computer-readable storage media of claim 33, wherein eachglobal snapshot of the list of active global snapshots is associatedwith a timestamp.
 36. The one or more tangible computer-readable storagemedia of claim 35, further comprising: maintaining a minimum activeglobal timestamp value representing an oldest timestamp for activeglobal snapshots in the list of active global timestamps.
 37. The one ormore tangible computer-readable storage media of claim 36, furthercomprising: sending the minimum active global timestamp value to theworker node for version garbage collection.
 38. The one or more tangiblecomputer-readable storage media of claim 33, wherein the requesting andsending the at least one global synchronization token are carried outsynchronously such that the worker node blocks at least some operationsuntil receiving the at least one global synchronization token.
 39. Amethod, implemented by at least one computing device comprising at leastone hardware processor and one or more tangible memories incommunication with the at least one hardware processor, the one or moretangible memories storing computer-executable instructions for causingthe at least one computing device to implement a coordinator node of adatabase system, the coordinator node being in communication at leastwith a first worker node, wherein the coordinator node is furtherconfigured to perform a method for facilitating database transactionprocessing within a database environment, the method comprising:receiving a request from the first worker node for at least first,second, and third synchronization tokens; starting a global snapshotassociated with the request, the global snapshot associated with a queryexecutable at least in part at the first worker node and executable atleast in part at a second worker node; sending the at least first,second, and third synchronization tokens to the first worker node, thesecond synchronization token comprising a watermark value cached by thecoordinator node and associated with status of the first worker node,indicating a number of times the first worker node has been restarted,and the third synchronization token comprising a watermark value cachedby the coordinator node and associated with the status of the secondworker node, indicating a number of times the second worker node hasbeen restarted, wherein the watermark values can be compared withcurrent values of respective worker nodes to determine if current statesof the respective worker nodes match states associated with the secondand third synchronization tokens; receiving a notification from thefirst worker node to end the global snapshot associated with therequest; and ending the global snapshot associated with the request. 40.The method of claim 39, wherein starting the global snapshot associatedwith the request comprises adding the global snapshot to a list ofglobal active snapshots.
 41. The method of claim 40, wherein each globalsnapshot of the list of global active snapshots is associated with atimestamp.
 42. The method of claim 41, further comprising: maintaining aminimum active global timestamp value representing an oldest timestampfor active global snapshots in the list of global active snapshots. 43.The method of claim 42, further comprising: sending the minimum activeglobal timestamp value to the first worker node for version garbagecollection.
 44. The method of claim 39, wherein the requesting andsending the at least first, second, and third synchronization tokens arecarried out synchronously such that the first worker node blocks atleast some operations until receiving the at least first, second, andthird synchronization tokens.
 45. A computing device implementing aserver, the computing device comprising one or more hardware processorsand one or more memories coupled to the one or more hardware processors,the one or more memories storing computer-executable instructions forcausing the computing device to perform operations implementing acoordinator node that facilitates database transaction processing withina database environment, the coordinator node being in communication witha first worker node, the operations comprising: receiving a request fromthe first worker node for at least first, second, and thirdsynchronization tokens; starting a global snapshot associated with therequest, the global snapshot associated with a query executable at leastin part at the first worker node and executable at least in part at asecond worker node; sending the at least first, second, and thirdsynchronization tokens to the first worker node, the secondsynchronization token comprising a watermark value cached by thecoordinator node and associated with status of the first worker node,indicating a number of times the first worker node has been restarted,and the third synchronization token comprising a watermark value cachedby the coordinator node and associated with the status of the secondworker, indicating a number of times the second worker node has beenrestarted, wherein the watermark values can be compared with currentvalues of respective worker nodes to determine if current states of therespective worker nodes match states associated with the second andthird synchronization tokens; receiving a notification from the firstworker node to end the global snapshot associated with the request; andending the global snapshot associated with the request.
 46. Thecomputing device of claim 45, wherein starting the global snapshotassociated with the request comprises adding the global snapshot to alist of global active snapshots.
 47. The computing device of claim 45,wherein each global snapshot of the list of global active snapshots isassociated with a timestamp.
 48. The computing device of claim 47,further comprising: maintaining a minimum active global timestamp valuerepresenting an oldest timestamp for the active global snapshots in thelist of global active snapshots.
 49. The computing device of claim 48,further comprising: sending the minimum active global timestamp value tothe first worker node for version garbage collection.
 50. The computingdevice of claim 45, wherein the requesting and sending the first,second, and third synchronization tokens are carried out synchronouslysuch that the first worker node blocks at least some operations untilreceiving the first, second, and third synchronization tokens.